/// <summary> /// Explicit call to remove entity. /// </summary> public virtual void Release() { if (poolData != null) { #if POOLMANAGER transform.parent = PoolManager.Pools[poolData.group].group; PoolManager.Pools[poolData.group].Despawn(transform); #else PoolController.ReleaseByGroup(poolData.group, transform); #endif } else { //just disable the object, really no need to destroy OnDespawned(); gameObject.SetActive(false); /* * if(gameObject.activeInHierarchy) * StartCoroutine(DestroyDelay()); * else { * Destroy(gameObject); * }*/ } }