28 lines
561 B
C#
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;
|
|
}
|
|
}
|
|
|
|
} |