public static void ReturnAll(this IGameObjectPool pool) { foreach (var item in pool.ActiveObjects.ToList()) { pool.Return(item); } }
public virtual void Recycle(IGameObjectPool gameObjectPool) { if (UnityObjWrapper != null) { gameObjectPool.Add(UnityObjWrapper); } }
public virtual void Recycle(IGameObjectPool gameObjectPool) { foreach (var asset in LoadedAssets) { gameObjectPool.Add(asset.Value); } }
public GameObject GetGameObject(string poolName) { IGameObjectPool pool = GameObjectPool.GetGameObjectPool(poolName); if (pool != null) { return(pool.Get()); } return(null); }
private void Start() { _pool = ServiceLocator.Instance.GetService <IGameObjectPool <BulletController> >(); }
public static GameObject Spawn(this IGameObjectPool obj, string poolName, Vector3 position, Quaternion rotation, float lifeTime) { return(GameObjectPool.Instance.Spawn(poolName, position, rotation, lifeTime)); }
public static string FindPoolName(this IGameObjectPool obj, GameObject gameObject) { return(GameObjectPool.Instance.FindPoolName(gameObject)); }
public static void Despawn(this IGameObjectPool obj, GameObject gameObject) { GameObjectPool.Instance.Despawn(gameObject); }
public static GameObject Spawn(this IGameObjectPool obj, string poolName) { return(GameObjectPool.Instance.Spawn(poolName)); }
public static GameObject Spawn(this IGameObjectPool obj, string poolName, Vector3 position) { return(GameObjectPool.Instance.Spawn(poolName, position)); }