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); } }
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>(); }
/// <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(); } } }