22 lines
556 B
C#
22 lines
556 B
C#
using UnityEngine;
|
|
|
|
namespace BrewMonster
|
|
{
|
|
public class ObjectSpawner : MonoSingleton<ObjectSpawner>
|
|
{
|
|
public GameObject InstantiateObject(GameObject prefab, Transform parent =null, bool setThisAsParent = true)
|
|
{
|
|
if (setThisAsParent)
|
|
{
|
|
return Instantiate(prefab, transform);
|
|
}
|
|
return Instantiate(prefab, parent);
|
|
}
|
|
|
|
public void DestroyGameObject(GameObject go, float delayTime=0)
|
|
{
|
|
Destroy(go,delayTime);
|
|
}
|
|
}
|
|
}
|