Example #1
0
 private bool UnUpPeekTrigger(float angle)
 {
     if ((!TriggS.LastValue.GetTrigger(CoverSystemTriggers.ct_UpPeek) || !(userInput.Fire2Press || player.PressFire2Button || player.SmbThrow.IsThrowing) /* || !isAngleInBound*/) && IsUpPeeking)
     {
         Events.InvokeOnUnUpPeek();
         player.SmbWeapon.TriggS.Release(c_OverrideKey_2);
         player.SmbThrow.TriggS.Release(c_OverrideKey_2);
         player.SmbLookIK.ReleaseOverrideLookAt(c_OverrideKey_2);
         animator.ResetTrigger(cap_ToPeek);
         animator.SetBool(cap_UpPeek, false);
         IsUpPeeking = false;
         if (playerCamera.IsOverridenWithKey(c_OverrideKey))
         {
             playerCamera.ChangePointerOfCamModderWithID(animator.GetFloat(cap_CoverSide) < 0 ? CCoverProps.cameraModifiersIdleLeft : CCoverProps.cameraModifiersIdleRight, c_OverrideKey);
         }
         if (playerCamera.IsOverridenWithKey(c_OverrideKey_2))
         {
             playerCamera.ReleaseOverride(c_OverrideKey_2);
         }
         return(true);
     }
     return(false);
 }
        public override void OnStateEnter(Animator animator, AnimatorStateInfo stateInfo, int layerIndex)
        {
            if (stateInfo.shortNameHash == h_Empty)
            {
                _mirroredAnimDoubleHandOnCall_IsCalled = false;

                player.SmbWeapon.LeftHandEnabled = true;

                UpperBodyLayerTarget = 0;

                ReleaseTriggers();
            }
            else if (stateInfo.shortNameHash == h_PullOut)
            {
                SetThrowable(nextThrowableIndex);
                if (cExploderPrefab.leftHandHoldPositionRotation && !UseMirrorThrow)
                {
                    leftHandHold.localRotation = cExploderPrefab.leftHandHoldPositionRotation.localRotation;
                    leftHandHold.localPosition = cExploderPrefab.leftHandHoldPositionRotation.localPosition;
                }
                else if (cExploderPrefab.rightHandHoldPositionRotation && UseMirrorThrow)
                {
                    rightHandHold2.localRotation = cExploderPrefab.rightHandHoldPositionRotation.localRotation;
                    rightHandHold2.localPosition = cExploderPrefab.rightHandHoldPositionRotation.localPosition;
                }

                if (cExploderPrefab)
                {
                    cExploderPrefab.PlayRandomSoundAsWeaponChild(cExploderPrefab.sounds.pulls, transform, true, transform);
                }
            }
            else if (stateInfo.shortNameHash == h_ToReady)
            {
                animator.SetInteger(cap_Throw, 1);
            }
            else if (stateInfo.shortNameHash == h_ReadyIdle)
            {
                throwDir = Quaternion.AngleAxis(-cExploderClone.additionalThrowAngleHorizontal, playerCamera.transform.right) * playerCamera.transform.forward;

                if (IndicatorTrigger() /*|| 1 == 1*/)
                {
                    if (!playerCamera.IsOverridenWithKey(c_overrideKey))
                    {
                        if (!player.SmbCover.IsInCover)
                        {
                            playerCamera.OverrideCamera(CThrowProps.cameraProps, 1, c_overrideKey);
                        }
                        else if (playerCamera.IsOverridenWithKey(c_overrideKey))
                        {
                            playerCamera.ChangePointerOfCamModderWithID(CThrowProps.cameraProps, c_overrideKey);
                        }
                    }
                }
            }
            else if (stateInfo.shortNameHash == h_Throw)
            {
                if (cExploderClone)
                {
                    cExploderClone.PlayRandomSoundAsWeaponChild(cExploderPrefab.sounds.throws, transform, transform);
                }
            }
        }