Files
the-peoples-messenger/Assets/Scripts/Utils/GameObjectEntry.cs
T
2026-08-24 13:53:58 +01:00

28 lines
561 B
C#

using System;
using System.Collections.Generic;
using UnityEngine;
namespace Utils
{
[Serializable]
public class GameObjectEntry
{
public string key;
public GameObject value;
}
public static class GameObjectEntryListExtensions
{
public static GameObject ByKey(this List<GameObjectEntry> entries, string key)
{
foreach (var entry in entries)
{
if (entry.key == key)
return entry.value;
}
return null;
}
}
}