Пример #1
0
    public void FActivate()
    {
        PC_Controller pc   = FindObjectOfType <PC_Controller>();
        PLY_SnapSpot  snap = FindObjectOfType <PLY_SnapSpot>();

        mPosToSnapTo    = pc.transform.position;
        mPosToSnapTo.y += 20f;
        if (pc.transform.position.z > snap.transform.position.z)
        {
            mPosToSnapTo.z += 15f;
        }
        else
        {
            mPosToSnapTo.z -= 15f;
        }
        transform.position = pc.GetComponentInChildren <PC_Camera>().transform.position;

        pc.GetComponentInChildren <Camera>().enabled        = false;
        pc.GetComponentInChildren <AudioListener>().enabled = false;
        cCam.enabled = true;
        GetComponent <AudioListener>().enabled = true;

        pc.mState = PC_Controller.PC_STATE.SINACTIVE;
        mState    = CAM_STATE.SACTIVE;
    }
Пример #2
0
    public void FDeactivate()
    {
        PC_Controller pc = FindObjectOfType <PC_Controller>();

        mPosToSnapTo = pc.GetComponentInChildren <PC_Camera>().transform.position;
        pc.mState    = PC_Controller.PC_STATE.SPRE_SNAP;
        mState       = CAM_STATE.S_DEACTIVATING;     // maybe not the best name
    }
Пример #3
0
    // This should be called ~0.5 seconds after FDeactivate, every time.
    private void TrueDeactivate()
    {
        cCam.enabled = false;
        GetComponent <AudioListener>().enabled = false;
        PC_Controller pc = FindObjectOfType <PC_Controller>();

        pc.GetComponentInChildren <Camera>().enabled        = true;
        pc.GetComponentInChildren <AudioListener>().enabled = true;

        mState = CAM_STATE.SINACTIVE;
    }
Пример #4
0
 public void SetState(CAM_STATE newState)
 {
     ClearIsRendering();
     State = newState;
     UpdateState();
 }