示例#1
0
        public void Update(CodeRigBoneParam param)
        {
            if (ThirdPersonIncluded)
            {
                StableUpperBody(param.OverlayAnimationWeight, param.PostureWhenOverlay);
                _ikControllerP3.SetIKActive(param.IKActive);
            }

            Peek(param.PeekAmplitude);
            PitchP1(param.PitchAmplitude);

            if (FirstPersonIncluded)
            {
                var parent = _characterP1.transform.parent;
                try
                {
                    _characterP1.transform.SetParent(null, false);

                    ResetSightModelScaleToAvoidSideEffect();
                    SetFirstPersonShift(CreateFirstPersonOffsetParam(param));
                    SetSightStatus(CreateSightStatusParam(param));
                    ScaleSightModelToFakeSpecialFov(param.ScopeScale);
                    _ikControllerP1.SetIKActive(param.IKActive);
                }
                finally
                {
                    _characterP1.transform.SetParent(parent, false);
                }
            }
        }
示例#2
0
 private static FirstPersonOffsetParam CreateFirstPersonOffsetParam(CodeRigBoneParam param)
 {
     return(new FirstPersonOffsetParam
     {
         IsFirstPerson = param.IsFirstPerson,
         IsSight = param.IsSight,
         HorizontalShift = param.IsSight ? param.SightMoveHorizontalShift : param.FastMoveHorizontalShift,
         VerticalShift = param.IsSight ? param.SightMoveVerticalShift : param.FastMoveVerticalShift,
         FirstPersonPositionOffset = param.FirstPersonPositionOffset,
         FirstPersonRotationOffset = param.FirstPersonRotationOffset
     });
 }
示例#3
0
 private static SightStatusParam CreateSightStatusParam(CodeRigBoneParam param)
 {
     return(new SightStatusParam
     {
         IsSight = param.IsSight,
         IsIntoSight = param.IsIntoSight,
         PeekAmplitude = param.PeekAmplitude,
         SightOffset = param.SightOffset,
         PitchAmplitude = param.PitchAmplitude,
         SightProgress = param.SightProgress,
         SightHorizontalShift = param.SightHorizontalShift /* * param.SightShiftBuff*/,
         SightVerticalShift = param.SightVerticalShift /* * param.SightShiftBuff*/,
         FirstPersonSightOffset = param.FirstPersonSightOffset,
         ScopeOffset = param.ScopeOffset,
         SightModelOffset = param.SightModelOffset
     });
 }