Beispiel #1
0
 public Car(ISpeedProvider moveSpeed, ISpeedProvider rotateSpeed, IAcceleration acceleration, ISurfaceInfo surfaceInfo)
 {
     m_MoveSpeed    = moveSpeed;
     m_RotateSpeed  = rotateSpeed;
     m_Acceleration = acceleration;
     m_SurfaceInfo  = surfaceInfo;
 }
Beispiel #2
0
 public void Init(IGame game, ISpeedProvider moveSpeed, ISpeedProvider rotateSpeed, IAcceleration acceleration, ISurfaceInfo surfaceInfo)
 {
     m_Game         = game;
     m_MoveSpeed    = moveSpeed;
     m_RotateSpeed  = rotateSpeed;
     m_Acceleration = acceleration;
     m_SurfaceInfo  = surfaceInfo;
 }
 public DefaultAcceleration(ISpeedProvider moveSpeed, ISurfaceInfo surface)
 {
     m_Speed   = moveSpeed;
     m_Surface = surface;
 }
Beispiel #4
0
 public SpeedManager(PlayerEntity player,
                     ICharacterPosture posture,
                     ICharacterMovement movement,
                     ICharacterPostureInConfig postureInConfig,
                     ICharacterMovementInConfig movementInConfig,
                     ISpeedProvider speedProvider)
 {
     _player                   = player;
     _posture                  = posture;
     _movement                 = movement;
     _postureInConfig          = postureInConfig;
     _movementInConfig         = movementInConfig;
     _speedProvider            = speedProvider;
     _speedConditionDictionary = new Dictionary <int, Action>()
     {
         // 落地
         {
             CharacterStateConfigHelper.GenerateId(PostureInConfig.Land, MovementInConfig.Null),
             () => { SetCurrentState(PostureInConfig.Null, MovementInConfig.Null); }
         },
         // 站立&静走
         {
             CharacterStateConfigHelper.GenerateId(PostureInConfig.Stand, MovementInConfig.Walk),
             () => { SetCurrentState(PostureInConfig.Stand, MovementInConfig.Walk); }
         },
         // 站立&跑步
         {
             CharacterStateConfigHelper.GenerateId(PostureInConfig.Stand, MovementInConfig.Run),
             () => { SetCurrentState(PostureInConfig.Stand, MovementInConfig.Run); }
         },
         // 站立&冲刺
         {
             CharacterStateConfigHelper.GenerateId(PostureInConfig.Stand, MovementInConfig.Sprint),
             () => { SetCurrentState(PostureInConfig.Stand, MovementInConfig.Sprint); }
         },
         // 蹲下&静走
         {
             CharacterStateConfigHelper.GenerateId(PostureInConfig.Crouch, MovementInConfig.Walk),
             () => { SetCurrentState(PostureInConfig.Crouch, MovementInConfig.Walk); }
         },
         // 蹲下&跑步
         {
             CharacterStateConfigHelper.GenerateId(PostureInConfig.Crouch, MovementInConfig.Run),
             () => { SetCurrentState(PostureInConfig.Crouch, MovementInConfig.Run); }
         },
         // 蹲下&冲刺
         {
             CharacterStateConfigHelper.GenerateId(PostureInConfig.Crouch, MovementInConfig.Sprint),
             () => { SetCurrentState(PostureInConfig.Crouch, MovementInConfig.Sprint); }
         },
         // 趴下&匍匐
         {
             CharacterStateConfigHelper.GenerateId(PostureInConfig.Prone, MovementInConfig.Null),
             () => { SetCurrentState(PostureInConfig.Prone, MovementInConfig.Walk); }
         },
         // 游泳
         {
             CharacterStateConfigHelper.GenerateId(PostureInConfig.Swim, MovementInConfig.Null),
             () => { SetCurrentState(PostureInConfig.Swim, MovementInConfig.Swim); }
         },
         // 潜水
         {
             CharacterStateConfigHelper.GenerateId(PostureInConfig.Dive, MovementInConfig.Null),
             () => { SetCurrentState(PostureInConfig.Dive, MovementInConfig.Dive); }
         },
         // 受伤
         {
             CharacterStateConfigHelper.GenerateId(PostureInConfig.Dying, MovementInConfig.Null),
             () => { SetCurrentState(PostureInConfig.Dying, MovementInConfig.Walk); }
         }
     };
 }
Beispiel #5
0
 public BulletSpeedProvider(float speed, ISpeedProvider worldSpeed)
 {
     this.speed = speed;
     this.worldSpeedProvider = worldSpeed;
 }