Esempio n. 1
0
 void Awake()
 {
     foreach (var config in _configs)
     {
         PoolSystem.CreatePool(config.id, config.prefab, config.size);
     }
     Destroy(gameObject);
 }
Esempio n. 2
0
        public bool ExecuteSpawn(string id, Vector3 position)
        {
            if (!PoolSystem.FetchAvailable(id, out GameObject gameObject))
            {
                return(false);
            }

            gameObject.transform.position = position;
            return(true);
        }
Esempio n. 3
0
        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);
        }
Esempio n. 4
0
 public static int TotalSpawned(string id)
 => PoolSystem.TotalAcquired(id);