Exemplo n.º 1
0
    void TutorialProcess()
    {
        if (CMainData.getGameState() == GameData.GAME_STATE_READY)
        {
            startTime = 0.0f;
            m_lScore  = 0;
            m_sBoard.initBoards();
            CTimeManager.SetTimer();
            MainGame.g_Instance.setSoundState(SOUND_STATE.SOUND_STATE_GAME_INTRO_READY);

            CMainData.setGameState(GameData.GAME_STATE_GAMEING);
            m_nTutorialState = GameData.startTutorialStep;
        }
        else if (CMainData.getGameState() == GameData.GAME_STATE_GAMEING)
        {
            CheckControl();
            CheckEvent();
            TutorialMainProcess();
        }
        else if (CMainData.getGameState() == GameData.GAME_STATE_PAUSE)
        {
        }
        else if (CMainData.getGameState() == GameData.GAME_STATE_GAMEOVER)
        {
        }
        else if (CMainData.getGameState() == GameData.GAME_STATE_TIMEUP)
        {
            GameOverProcess();
        }

        PlayBGM();
    }
Exemplo n.º 2
0
    public void PauseButton()
    {
        Debug.Log("Pause");
        ButtonClickSound();

        if (CMainData.getGameState() == GameData.GAME_STATE_GAMEING && !CMainData.getPause())
        {
            CMainData.setPause(true);
            CMainData.setGameState(GameData.GAME_STATE_PAUSE);
            NGUITools.SetActive(Pause_Menu, true);
        }
    }
Exemplo n.º 3
0
    void GameProcess()
    {
        if (CMainData.getGameState() == GameData.GAME_STATE_READY)
        {
            startTime = 0.0f;
            m_lScore  = 0;
            m_sBoard.initBoards();
            m_sBoard.makeStartDice();
            CTimeManager.SetTimer();

            if (gameSceneUI)
            {
                gameSceneUI.ChangeState(CMainData.getGameState());
            }

            CMainData.setGameState(GameData.GAME_STATE_START);
            CKeyManager.ControlOn();

            m_nTutorialState = TUTORIAL_STEP.TUTORIAL_STEP_NONE;
        }
        else if (CMainData.getGameState() == GameData.GAME_STATE_START)
        {
            processReadyUI();
        }
        else if (CMainData.getGameState() == GameData.GAME_STATE_GAMEING)
        {
            CheckControl();
            CheckEvent();
            CheckTimer();
            if (CheckBoard())
            {
                CMainData.setGameState(GameData.GAME_STATE_GAMEOVER);
            }
        }
        else if (CMainData.getGameState() == GameData.GAME_STATE_PAUSE)
        {
        }
        else if (CMainData.getGameState() == GameData.GAME_STATE_GAMEOVER)
        {
            GameOverProcess();
        }
        else if (CMainData.getGameState() == GameData.GAME_STATE_TIMEUP)
        {
            GameOverProcess();
        }

        PlayBGM();
    }
Exemplo n.º 4
0
    void processReadyUI()
    {
        startTime += Time.deltaTime;
        if (startTime > GameData.TIMER_READY + GameData.TIMER_GO)
        {
            CMainData.setGameState(GameData.GAME_STATE_GAMEING);

            if (gameSceneUI)
            {
                gameSceneUI.ChangeState(CMainData.getGameState());
            }
        }
        else if (startTime > GameData.TIMER_READY)
        {
            if (gameSceneUI)
            {
                gameSceneUI.ChangeState(CMainData.getGameState());
            }
        }
    }
Exemplo n.º 5
0
    void OnGUI()
    {
        //pause
        if (CMainData.getPause() == true)
        {
            if (buttonType == (int)BUTTON.G_PAUSE)
            {
                return;
            }
        }
        else if (CMainData.getGameState() == GameData.GAME_STATE_TIMEUP)
        {
            if (buttonType == (int)BUTTON.G_PAUSE ||
                buttonType == (int)BUTTON.G_RESUME)
            {
                return;
            }
        }
        else
        {
            if (buttonType == (int)BUTTON.G_RESUME ||
                buttonType == (int)BUTTON.G_RESTART ||
                buttonType == (int)BUTTON.G_MAINMENU)
            {
                return;
            }
        }
        //sound
        if (CMainData.getSound() == true)
        {
            if (buttonType == (int)BUTTON.G_SOUND_OFF)
            {
                return;
            }
        }
        else
        {
            if (buttonType == (int)BUTTON.G_SOUND_ON)
            {
                return;
            }
        }

        //check button
        if (img == null)
        {
            //set button background color
            GUI.backgroundColor = Color.white;

            if (GUI.Button(rect, text))
            {
                //button processing
                buttonProcessing(buttonType);
            }
        }
        else
        {
            //none show button background window
            GUI.backgroundColor = Color.clear;

            if (GUI.Button(rect, img))
            {
                //button processing
                buttonProcessing(buttonType);
            }
        }
    }