예제 #1
0
    private void ENTER_INSTRUCTIONS()
    {
        Cursor.lockState = CursorLockMode.Locked;

        MN_PauseScreen.SetActive(false);
        refUI.gameObject.SetActive(false);
        refInstrUI.SetActive(true);
        refScoreboardUI.SetActive(false);

        mGameState = PP_GAME_STATE.CHILLING;
        mState     = PP_State.DISPLAY_INSTRUCTIONS;

        // Note, this needs to be polished, the rotations can get wonky.
        refPC.transform.rotation = Quaternion.Euler(0f, 0f, 0f);
        refPC.GetComponentInChildren <PC_Camera>().transform.rotation = Quaternion.Euler(0f, 0f, 0f);
        refPC.mState = PC_Controller.PC_STATE.SINACTIVE;
        refPC.GetComponent <Rigidbody>().velocity = Vector3.zero;

        // this is kind of to solve a bug with respect to throwing.
        TDC_EventManager.FBroadcast(TDC_GE.GE_QB_StopThrow);

        DestroyExistingProjectilesArrowsAndDeactivateTurrets();
        // Also destroy all footballs
        PROJ_Football[] refFootballs = FindObjectsOfType <PROJ_Football>();
        for (int i = 0; i < refFootballs.Length; i++)
        {
            Destroy(refFootballs[i].gameObject);
        }
    }
예제 #2
0
    private void ENTER_SCORESCREEN()
    {
        bool bNewHighScore = false;

        if (lDifData.mName == "EASY")
        {
            if (IO_GamerInfo.mInfo.mPPHighScores.mEasyScore < mScore)
            {
                IO_GamerInfo.mInfo.mPPHighScores.mEasyScore = mScore;
                bNewHighScore = true;
            }
        }
        else if (lDifData.mName == "NORMAL")
        {
            if (IO_GamerInfo.mInfo.mPPHighScores.mNormalScore < mScore)
            {
                IO_GamerInfo.mInfo.mPPHighScores.mNormalScore = mScore;
                bNewHighScore = true;
            }
        }
        else if (lDifData.mName == "HARD")
        {
            if (IO_GamerInfo.mInfo.mPPHighScores.mHardScore < mScore)
            {
                IO_GamerInfo.mInfo.mPPHighScores.mHardScore = mScore;
                bNewHighScore = true;
            }
        }
        else if (lDifData.mName == "PETERMAN")
        {
            if (IO_GamerInfo.mInfo.mPPHighScores.mPetermanScore < mScore)
            {
                IO_GamerInfo.mInfo.mPPHighScores.mPetermanScore = mScore;
                bNewHighScore = true;
            }
        }
        if (bNewHighScore)
        {
            IO_GamerInfo.FWriteGamerData(IO_GamerInfo.mInfo);
        }


        Cursor.lockState = CursorLockMode.None;
        Cursor.visible   = true;

        mState = PP_State.SCORE_SCREEN;

        refUI.gameObject.SetActive(false);
        refInstrUI.gameObject.SetActive(false);
        refScoreboardUI.SetActive(true);
        if (bNewHighScore)
        {
            refScoreboardUI.GetComponent <PP_Scoreboard>().mNewHighScoreTXT.text = "NEW HIGH SCORE!";
        }
        else
        {
            refScoreboardUI.GetComponent <PP_Scoreboard>().mNewHighScoreTXT.text = "Good Game";
        }

        DestroyExistingProjectilesArrowsAndDeactivateTurrets();

        PC_Controller refPC = FindObjectOfType <PC_Controller>();

        refPC.mState = PC_Controller.PC_STATE.SINACTIVE;
        refPC.GetComponent <Rigidbody>().velocity = Vector3.zero;
    }