Esempio n. 1
0
    void Update()
    {
        //TEST
        TestingGetcurrentScreen();
        //print (_state.name); //TEST

        buttons.Back();

        Charging();
        LocalTime();

        if (_state.name != "init")
        {
            display.RealTime(hour, minute, amPm);
            //TEST
            if (timeForNextBat > 0)
            {
                display.BatCountDown(true, timeForNextBat);
            }
            else
            {
                display.BatCountDown(false);
            }
        }

        switch (_state.name)
        {
        case "init":
            InitState();
            break;

        case "mainMenu":
            MainMenuState();
            break;

        case "startGame":
            StartGameState();
            break;

        case "playCountDown":
            PlayCountDown();
            break;

        case "playing":
            PlayingState();
            break;

        case "crashed":
            CrashedState();
            break;

        case "paused":
            PausedState();
            break;

        case "gameOver":
            GameOverState();
            break;

        default:
            Debug.Log("No se encuentra en ningún estado");     //TEST
            break;
        }
        print(_state.name);
    }