public static GameObject Instantiate(string name, Vector3 position, Quaternion quat, Transform parent = null, GameObject prefab = null, bool pool = false, float max = Mathf.Infinity) { GameObject aux; if (!pool) { aux = GameObject.Instantiate(prefab, position, quat, parent); aux.name = name; } else { aux = StaticPool.Instantiate(prefab, position, parent, max); aux.AddOnlyOneComponent <MultiTags>(); aux.AddTags("pool"); } return(aux); }
void Create() { StaticPool.Instantiate(obj, Vector3.down, gameObject.transform, 2); Invoke("Create", 1f); }
void Put() { StaticPool.Instantiate(obj, Vector3.down, gameObject.transform); Invoke("Put", time); }
void SpawnEnemy() { StaticPool.Instantiate(enemyPrefab, enemyPrefab.transform.position); }
void Create() { StaticPool.Instantiate(obj, Vector3.down, gameObject.transform, numberMax); Invoke("Put", time); }