private void FromTpToFp(bool isRelease, FirstPersonCameraParams _nextParams) { cameraType = CamType.ThirdPersonToFirstPersonTransition; currentFPModderParams.Reset(); currentFPModderParams += _nextParams; lastVerticalRot = VerticalRotation; lastHorizontalRot = HorizontalRotation; }
private void Start() { plAnimator = GameObject.FindGameObjectWithTag("Player").GetComponent <Animator>(); if (plAnimator) { if (dontFollowBone) { followTransform = plAnimator.transform; } else { followTransform = plAnimator.GetBoneTransform(followBone); } if (dontPositionToBone) { positionFreeLookTransform = plAnimator.transform; } else { positionFreeLookTransform = plAnimator.GetBoneTransform(positionFreeLookBone); } } userInput = plAnimator.GetComponent <SetupAndUserInput>(); player = userInput.GetComponent <PlayerAtts>(); plCapCollider = userInput.GetComponent <CapsuleCollider>(); Cam = transform.Find("Main Camera").GetComponent <Camera>(); moveReference = transform.Find("Move Reference"); if (!plAnimator || !followTransform || !userInput || !player || !plCapCollider || !Cam || !moveReference) { if (userInput) { userInput.DisablePlayer("Needed reference not found on Player Camera script"); } enabled = false; } currentTPModderParams = new ThirdPersonCameraParams(); currentFPModderParams = new FirstPersonCameraParams(); camPosShakers = new List <CameraShaker>(); camRotShakers = new List <CameraShaker>(); HorizontalRotation = startRotations.x; VerticalRotation = startRotations.y; }
public void ChangePointerOfCamModderWithID(CameraModderParamsBase _newCamModderParam, string _modifierID) { if (!camTypeDict.IsOverridenWithKey(_modifierID)) { Debug.Log("No such key-id found, skipping param change... id: " + _modifierID); return; } camTypeDict.Modify(_modifierID, _newCamModderParam); if (_newCamModderParam.GetType() == typeof(ThirdPersonCameraParams)) { currentTPModderParams.Reset(); currentTPModderParams += _newCamModderParam as ThirdPersonCameraParams; } else if (_newCamModderParam.GetType() == typeof(FirstPersonCameraParams)) { currentFPModderParams.Reset(); currentFPModderParams += _newCamModderParam as FirstPersonCameraParams; } else if (_newCamModderParam.GetType() == typeof(FocusCameraParams)) { currentFocusModderParams = _newCamModderParam as FocusCameraParams; } }
private void FromFpToFp(bool isRelease, FirstPersonCameraParams _nextParams) { FromTpToFp(isRelease, _nextParams); }