public IEnumerator KillMenu() { BallSpawnRegion ballSpawnRegion = menuGameInstance.GetComponentInChildren <BallSpawnRegion>(); ballSpawnRegion.DestroyActiveBalls(new Vector3()); yield return(new WaitForSeconds(.5f)); StartCoroutine(WaitToKillBackgroundMenu()); SpawnGame(); }
public void OnCollisionEnter2D(Collision2D collision) { if (collision.gameObject.GetComponent <Ball>() == null) { return; } deathListener(score); Explodable explodable = GetComponent <Explodable>(); explodable.explode(explosionForce, transform.position); ballSpawnRegion.DestroyActiveBalls(transform.position); moveRight.move = false; Singleton <SlowmoManager> .Instance.StartSlowmo(); }