private IEnumerator ReturnAfterDelay(ExplosionView _explosion) { yield return(new WaitForSeconds(explosionAnimDuration)); _explosion.SetEnabled(false); ExplosionPool.Instance.ReturnItem(_explosion); }
public void CreateExplosionAt(Vector2 _position) { ExplosionView explosion = ExplosionPool.Instance.GetItem(); explosion.SetPosition(_position); explosion.SetEnabled(true); StartCoroutine(ReturnAfterDelay(explosion)); }