Example #1
0
 public void Despawn(Poolee poolee)
 {
     if (!_activeObjects.ContainsKey(poolee.Key))
     {
         return;
     }
     _inActiveObjects.Add(poolee.Key, poolee);
     _activeObjects.Remove(poolee.Key);
     poolee.gameObject.SetActive(false);
 }
 private static void Despawn(Poolee poolee, float time)
 {
     _instance.StartCoroutine(DespawnCoroutine(poolee, time));
 }
 private static void Despawn(Poolee poolee)
 {
     if (!_instance._poolDictionary.ContainsKey(poolee.PoolType))
         return;
     _instance._poolDictionary[poolee.PoolType].Despawn(poolee);
 }
 private static IEnumerator DespawnCoroutine(
     Poolee poolee, float time)
 {
     yield return new WaitForSeconds(time);
     Despawn(poolee);
 }