add dynamic spawning
This commit is contained in:
@@ -0,0 +1,28 @@
|
||||
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;
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
Reference in New Issue
Block a user