Add simple audio system

This commit is contained in:
WillJeynes
2026-08-25 17:22:12 +01:00
parent 4c3f94dba1
commit c92d5a633a
20 changed files with 346 additions and 23 deletions
+21 -15
View File
@@ -4,24 +4,30 @@ using UnityEngine;
namespace Utils
{
[Serializable]
public class GameObjectEntry
namespace Utils
{
public string key;
public GameObject value;
}
public static class GameObjectEntryListExtensions
{
public static GameObject ByKey(this List<GameObjectEntry> entries, string key)
[Serializable]
public class GameEntry<T>
{
foreach (var entry in entries)
{
if (entry.key == key)
return entry.value;
}
public string key;
public T value;
}
return null;
public static class GameObjectEntryListExtensions
{
public static T ByKey<T>(
this List<GameEntry<T>> entries,
string key
) where T : class
{
foreach (var entry in entries)
{
if (entry.key == key)
return entry.value;
}
return null;
}
}
}