Files
2026-08-25 17:22:12 +01:00

34 lines
706 B
C#

using System;
using System.Collections.Generic;
using UnityEngine;
namespace Utils
{
namespace Utils
{
[Serializable]
public class GameEntry<T>
{
public string key;
public T value;
}
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;
}
}
}
}