private void OnCollisionEnter(Collision collision) { if (state != State.Alive || collisionDisabled) //ignore collisions { return; } switch (collision.gameObject.tag) { case "Friendly": break; case "Finish": StartSuccessSequence(); break; default: if (gameCanvasSession.GetLiveCount() > 1) { gameCanvasSession.LivesDecrease(); gameCanvasSession.ResetScene(); gameCanvasSession.ResetTimer(); } else { gameCanvasSession.LivesDecrease(); StartDeathSequence(); } break; } }
//===================Levels============================ public void Level1() { gameCanvasSession.ResetLivesCounter(); gameCanvasSession.ResetTexts(); gameCanvasSession.ResetTimer(); SceneManager.LoadScene(1); }