//Preparation to load next level void PrepareToLoadNextLevel() { PlayerOnFinish = true; AudioSource.Stop(); AudioSource.PlayOneShot(winSound); foreach (ParticleSystem winParticle in winParticles) { winParticle.Play(); } LevelManagementScript.Invoke("LoadNextLevel", invokeTimeBeforeLoadLevel); }
//Invoking method that restarts current level void InvokeToRestartLevel() { Destroy(gameObject); LevelManagementScript.Invoke("RestartLevel", 1f); }