Exemplo n.º 1
0
        private void FromTpToFp(bool isRelease, FirstPersonCameraParams _nextParams)
        {
            cameraType = CamType.ThirdPersonToFirstPersonTransition;
            currentFPModderParams.Reset();
            currentFPModderParams += _nextParams;

            lastVerticalRot   = VerticalRotation;
            lastHorizontalRot = HorizontalRotation;
        }
Exemplo n.º 2
0
        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;
        }
Exemplo n.º 3
0
        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;
            }
        }
Exemplo n.º 4
0
 private void FromFpToFp(bool isRelease, FirstPersonCameraParams _nextParams)
 {
     FromTpToFp(isRelease, _nextParams);
 }