コード例 #1
0
 public void CheckWorkActivationState(TimeUpdateEvent evt, ShaftAimingWorkActivationWeaponControllerNode weapon)
 {
     if (!this.CheckHandleWeaponIntersectionStatus(weapon.Entity))
     {
         if (!InputManager.CheckAction(ShotActions.SHOT))
         {
             this.MakeQuickShot(weapon.Entity);
         }
         else if (weapon.shaftAimingWorkActivationState.ActivationTimer < weapon.shaftStateConfig.ActivationToWorkingTransitionTimeSec)
         {
             weapon.shaftAimingWorkActivationState.ActivationTimer += evt.DeltaTime;
         }
         else
         {
             MuzzleLogicAccessor accessor = new MuzzleLogicAccessor(weapon.muzzlePoint, weapon.weaponInstance);
             ShaftAimingWorkingStateComponent component = new ShaftAimingWorkingStateComponent {
                 InitialEnergy    = weapon.weaponEnergy.Energy,
                 WorkingDirection = accessor.GetFireDirectionWorld()
             };
             StateUtils.SwitchEntityState(weapon.Entity, component, this.weaponStates);
         }
     }
 }
コード例 #2
0
        private bool CheckManualTargetingActivity(WeaponRotationControlComponent rotation, VerticalSectorsTargetingComponent verticalSectors, ShaftAimingWorkingStateComponent working, bool isInputActive)
        {
            if (rotation.IsRotating())
            {
                return(true);
            }
            if (!isInputActive)
            {
                return(false);
            }
            float verticalAngle = working.VerticalAngle;

            return((verticalAngle != verticalSectors.VAngleUp) ? (verticalAngle != -verticalSectors.VAngleDown) : false);
        }