Example #1
0
    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;
        }
    }
Example #2
0
 //===================Levels============================
 public void Level1()
 {
     gameCanvasSession.ResetLivesCounter();
     gameCanvasSession.ResetTexts();
     gameCanvasSession.ResetTimer();
     SceneManager.LoadScene(1);
 }