void Awake() { foreach (var config in _configs) { PoolSystem.CreatePool(config.id, config.prefab, config.size); } Destroy(gameObject); }
public bool ExecuteSpawn(string id, Vector3 position) { if (!PoolSystem.FetchAvailable(id, out GameObject gameObject)) { return(false); } gameObject.transform.position = position; return(true); }
private bool ExecuteSpawn(string id, Vector3 position, out Poolable poolable) { if (!PoolSystem.FetchAvailable(id, out GameObject gameObject)) { poolable = default; return(false); } poolable = gameObject.GetComponentInChildren <Poolable>(); gameObject.transform.position = position; return(true); }
public static int TotalSpawned(string id) => PoolSystem.TotalAcquired(id);