Exemplo n.º 1
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.º 2
0
    void Update()
    {
        if (CMainData.getPause() == true)
        {
            return;
        }

        switch (m_nState)
        {
        case GameData.OBJECT_STATE_MOVE_RIGHT:
        case GameData.OBJECT_STATE_MOVE_LEFT:
        case GameData.OBJECT_STATE_MOVE_UP:
        case GameData.OBJECT_STATE_MOVE_DOWN:
            Move();
            break;

        case GameData.OBJECT_STATE_APPEAR:
            Appear();
            break;

        case GameData.OBJECT_STATE_DISAPPEAR:
            Disappear();
            break;

        default:
            break;
        }

        appearEffectProcess();

        if (m_nState == GameData.OBJECT_STATE_NONE)
        {
            if (MainGame.g_Instance.GetCursor().transform.position.x == transform.position.x &&
                MainGame.g_Instance.GetCursor().transform.position.z == transform.position.z)
            {
                transform.position = new Vector3(transform.position.x, -0.1f, this.transform.position.z);
            }
            else
            {
                transform.position = new Vector3(transform.position.x, 0.0f, this.transform.position.z);
            }
        }
    }
Exemplo n.º 3
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);
            }
        }
    }