Ejemplo n.º 1
0
    protected virtual void UpdateCameraStates()
    {
        // CAMERA STATE - you can change the CameraState here, the bool means if you want lerp of not, make sure to use the same CameraState String that you named on TPCameraListData

        if (cam == null)
        {
            cam = FindObjectOfType <ThirdPersonCamera>();
            if (cam == null)
            {
                return;
            }
            if (cam)
            {
                cam.SetMainTarget(this.transform);
                cam.Init();
            }
        }
        if (changeCameraState)
        {
            cam.ChangeState(desiredCameraState, customlookAtPoint, smoothCameraState);
        }
        else if (blackboard.isCrouching)
        {
            cam.ChangeState("Crouch", true);
        }
        else
        {
            cam.ChangeState("MovementState", true);
        }
    }
Ejemplo n.º 2
0
    private void Start()
    {
        tpCamera       = GameObject.FindObjectOfType <ThirdPersonCamera>();
        cameraSwitcher = tpCamera.gameObject.GetComponent <CameraStyleSwitcher>();
        if (tpCamera)
        {
            tpCamera.SetMainTarget(this.transform);
        }

        tpInput    = this.GetComponent <PlayerInput>();
        tpMovement = this.GetComponent <PlayerMovement>();
    }
Ejemplo n.º 3
0
 /// <summary>
 ///     Set the TPC Camara
 /// </summary>
 protected virtual void InitializeTpCamera()
 {
     if (tpCamera == null)
     {
         tpCamera = FindObjectOfType <ThirdPersonCamera>();
         if (tpCamera == null)
         {
             return;
         }
         if (tpCamera)
         {
             tpCamera.SetMainTarget(this.transform);
             tpCamera.Init();
         }
     }
 }