Ejemplo n.º 1
0
    private void ENTER_GAMING()
    {
        Cursor.lockState = CursorLockMode.Locked;

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

        refUI.gameObject.SetActive(true);

        // testing this bug.
        Time.timeScale = 1f;

        // Activate all the turrets and the pc in the scene.
        cTurMan.FActivateTurrets();

        PC_Controller refPC = FindObjectOfType <PC_Controller>();

        refPC.mState = PC_Controller.PC_STATE.SACTIVE;
        Vector3 vPCPos = FindObjectOfType <PP_Pocket>().transform.position;

        vPCPos.y = 1f;
        refPC.transform.position = vPCPos;

        mScore = 0;
        ChangeScore(0);     // ah side effects, lovely aren't they?
        mStreak      = 0;
        mStreakBonus = 1;

        mTimeLeft = mGameTime;

        cTargMan.FDeactivateReceiver();
    }
Ejemplo n.º 2
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);
        }
    }