コード例 #1
0
 private void OnGetState(EntityUid uid, MovementSpeedModifierComponent component, ref ComponentGetState args)
 {
     args.State = new MovementSpeedModifierComponentState
     {
         BaseWalkSpeed       = component.BaseWalkSpeed,
         BaseSprintSpeed     = component.BaseSprintSpeed,
         WalkSpeedModifier   = component.WalkSpeedModifier,
         SprintSpeedModifier = component.SprintSpeedModifier,
     };
 }
コード例 #2
0
 private void OnHandleState(EntityUid uid, MovementSpeedModifierComponent component, ref ComponentHandleState args)
 {
     if (args.Current is not MovementSpeedModifierComponentState state)
     {
         return;
     }
     component.BaseWalkSpeed       = state.BaseWalkSpeed;
     component.BaseSprintSpeed     = state.BaseSprintSpeed;
     component.WalkSpeedModifier   = state.WalkSpeedModifier;
     component.SprintSpeedModifier = state.SprintSpeedModifier;
 }
コード例 #3
0
 protected void OnChanged()
 {
     MovementSpeedModifierComponent.RefreshItemModifiers(Owner);
 }