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

            gameObject.transform.position = position;
            return(true);
        }
コード例 #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);
        }
コード例 #4
0
 public static int TotalSpawned(string id)
 => PoolSystem.TotalAcquired(id);