private IEnumerator bomb() { yield return(new WaitForSeconds(2f)); system.Play(); source.Play(); agent.isStopped = true; foreach (Renderer rend in GetComponentsInChildren <MeshRenderer>()) { rend.enabled = false; } if (isPlayerInside) { damageTaker.Hurt(this.transform.position); } yield return(new WaitWhile(() => system.isPlaying && source.isPlaying)); yield return(new WaitForSeconds(0.5f)); Destroy(this.gameObject); }