Exemplo n.º 1
0
        private void Ovr(bool isEdgePeek, bool isLeftPeek)
        {
            if (!player.SmbThrow.IsThrowing)
            {
                player.SmbWeapon.TriggS.Override(c_OverrideKey_2, 0, new WeaponSystemTriggers(false, false, false, true, true, false, false, false, false));
            }
            else
            {
                player.SmbWeapon.TriggS.Override(c_OverrideKey_2, 0, new WeaponSystemTriggers(false));
            }
            if (player.SmbThrow.IsThrowing)
            {
                player.SmbThrow.TriggS.Override(c_OverrideKey_2, 0, new ThrowSystemTriggers(true, false, true));
            }
            else
            {
                player.SmbThrow.TriggS.Override(c_OverrideKey_2, 0, new ThrowSystemTriggers(false));
            }

            ThirdPersonCameraParams modder = isEdgePeek ? (isLeftPeek ? CCoverProps.cameraModifiersEdgePeekLeft : CCoverProps.cameraModifiersEdgePeekRight) :
                                             (isLeftPeek ? CCoverProps.cameraModifiersUpPeekLeft : CCoverProps.cameraModifiersUpPeekRight);

            if (!playerCamera.IsOverridenWithKey(c_OverrideKey_2))
            {
                playerCamera.OverrideCamera(modder, -2, c_OverrideKey_2);
            }

            player.SmbLookIK.OverrideLookAtTransform(new LookAtTransformParams(RefTarget, player.Animator.GetBoneTransform(HumanBodyBones.Hips), player.SmbLookIK.HasBindedLookIKStyleToWeaponStyle(player.SmbWeapon.GetCGunStyle())), -2, c_OverrideKey_2);
        }
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 FromFpToTp(bool isRelease, ThirdPersonCameraParams _nextParams)
 {
     FromTpToTp(isRelease, _nextParams);
     VerticalRotation   = lastVerticalRot;
     HorizontalRotation = lastHorizontalRot;
 }
Exemplo n.º 5
0
 private void FromFocusToTp(bool isRelease, ThirdPersonCameraParams _nextParams)
 {
     FromFpToTp(isRelease, _nextParams);
 }
Exemplo n.º 6
0
 private void FromTpToTp(bool isRelease, ThirdPersonCameraParams _nextParams)
 {
     cameraType = CamType.ThirdPerson;
     currentTPModderParams.Reset();
     currentTPModderParams += _nextParams;
 }