Exemplo n.º 1
0
    private void ChangeScene(Structs.GameScene to)
    {
        currentScene = to;

        //Debug.Log("Change scene to: " + currentScene);

        switch (currentScene)
        {
        case Structs.GameScene.Initialization:
            SwitchToMenu();
            break;

        case Structs.GameScene.Menu:
            managerInput.SetEvents();
            managerUI.SetPanels();
            break;

        case Structs.GameScene.LoadingGame:
            gameManager.ResetGame();
            gameManager.StartGame();
            managerUI.SetPanels();
            managerCamera.SwitchToCamera(ManagerCamera.Cameras.Static);

            // And go!
            SwitchToIngame();
            break;

        case Structs.GameScene.Ingame:
            gameManager.OnEndGame += GameEnd;


            managerInput.SetEvents();
            managerUI.SetPanels();
            break;

        case Structs.GameScene.GameEnd:
            gameManager.OnEndGame -= GameEnd;
            managerCamera.SwitchToCamera(ManagerCamera.Cameras.Motion);
            //gameManager.ResetGame(); // not necessary
            managerUI.SetCurrentPlayer(GameManager.Players.None.ToString());
            //managerUI.SetWinner( gameManager.GetCurrentPlayer().ToString() );

            SwitchToScore();
            break;

        case Structs.GameScene.Score:
            managerInput.SetEvents();
            managerUI.SetPanels();
            break;

        case Structs.GameScene.Exit:
            Application.Quit();
            break;
        }
    }