using UnityEngine; namespace BrewMonster { public class ObjectSpawner : MonoSingleton { protected override void Awake() { base.Awake(); } public GameObject InstantiateObject(GameObject prefab, Transform parent =null, bool setThisAsParent = true) { if (prefab == null) { BMLogger.LogError("ObjectSpawner::InstantiateObject, prefab is null"); return GameObject.CreatePrimitive(PrimitiveType.Cube); } if (setThisAsParent) { return Instantiate(prefab, transform); } return Instantiate(prefab, parent); } public void DestroyGameObject(GameObject go, float delayTime=0) { Destroy(go,delayTime); } } }