Add simple audio system
This commit is contained in:
@@ -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;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user