예제 #1
0
    public void SwitchScene(string scene)
    {
        musicController = GameObject.Find ("MusicController").GetComponent<MusicController>();

        if (scene == "titleScreen")
        {
            musicController.Transition(1);
        }
        else if (scene == "castle")
        {
            musicController.Transition(2);
        }
        else if (scene == "winScreen")
        {
            musicController.Transition(3);
        }
        else if (scene == "gameOverScreen")
        {
            musicController.Transition(4);
        }

        Application.LoadLevel (scene);
    }
예제 #2
0
 void OnTriggerEnter2D(Collider2D coll)
 {
     musicController = GameObject.Find ("MusicController").GetComponent<MusicController> ();
     musicController.Transition (3);
     Application.LoadLevel ("winScreen");
 }