static void OnUpdateSlider(MySyncMotorSuspension sync, ref UpdateSliderMsg msg, MyNetworkClient sender)
        {
            switch (msg.Slider)
            {
                case SliderEnum.Height:
                    sync.Entity.Height = msg.Value;
                    break;
                case SliderEnum.MaxSteerAngle:
                    sync.Entity.MaxSteerAngle = msg.Value;
                    break;
                case SliderEnum.SteerSpeed:
                    sync.Entity.SteerSpeed = msg.Value;
                    break;
                case SliderEnum.SteerReturnSpeed:
                    sync.Entity.SteerReturnSpeed = msg.Value;
                    break;
                case SliderEnum.InvertSteer:
                    sync.Entity.InvertSteer = msg.Value > 0;
                    break;
                case SliderEnum.SuspensionTravel:
                    sync.Entity.SuspensionTravel = msg.Value;
                    break;
            }

            if (Sync.IsServer)
            {
                Sync.Layer.SendMessageToAllButOne(ref msg, sender.SteamUserId);
            }
        }
 static void OnUpdateSteer(MySyncMotorSuspension sync, ref SteerMsg msg, MyNetworkClient sender)
 {
     sync.Entity.SteerAngle = msg.Steer;
     if (Sync.IsServer)
     {
         Sync.Layer.SendMessageToAllButOne(ref msg, sender.SteamUserId);
     }
 }
        internal void ChangeSlider(MySyncMotorSuspension.SliderEnum slider, float v)
        {
            var msg = new UpdateSliderMsg();
            msg.EntityId = Entity.EntityId;
            msg.Slider = slider;
            msg.Value = v;

            Sync.Layer.SendMessageToServerAndSelf(ref msg);
        }
 static void OnChangeFriction(MySyncMotorSuspension sync, ref FrictionMsg msg, MyNetworkClient sender)
 {
     sync.Entity.Friction = msg.Friction;
     if (Sync.IsServer)
     {
         Sync.Layer.SendMessageToAllButOne(ref msg, sender.SteamUserId);
     }
 }
 static void OnChangePower(MySyncMotorSuspension sync, ref PowerMsg msg, MyNetworkClient sender)
 {
     sync.Entity.Power = msg.Power;
     if (Sync.IsServer)
     {
         Sync.Layer.SendMessageToAllButOne(ref msg, sender.SteamUserId);
     }
 }
 static void OnChangeDamping(MySyncMotorSuspension sync, ref DampingMsg msg, MyNetworkClient sender)
 {
     sync.Entity.Damping = msg.Damping;
     if (Sync.IsServer)
     {
         Sync.Layer.SendMessageToAllButOne(ref msg, sender.SteamUserId);
     }
 }
 static void OnChangeStrength(MySyncMotorSuspension sync, ref StrengthMsg msg, MyNetworkClient sender)
 {
     sync.Entity.Strength = msg.Strength;
     if (Sync.IsServer)
     {
         Sync.Layer.SendMessageToAllButOne(ref msg, sender.SteamUserId);
     }
 }
 static void OnUpdateSteer(MySyncMotorSuspension sync, ref SteerMsg msg, MyNetworkClient sender)
 {
     sync.Entity.SteerAngle = msg.Steer;
 }
Пример #9
0
 static void OnChangeControllable(MySyncMotorSuspension sync, ref SteeringMsg msg, MyNetworkClient sender)
 {
     sync.Entity.Steering = msg.Steering;
 }
 static void OnChangeFriction(MySyncMotorSuspension sync, ref FrictionMsg msg, MyNetworkClient sender)
 {
     sync.Entity.Friction = msg.Friction;
 }
 static void OnChangePower(MySyncMotorSuspension sync, ref PowerMsg msg, MyNetworkClient sender)
 {
     sync.Entity.Power = msg.Power;
 }
 static void OnChangePropulsion(MySyncMotorSuspension sync, ref PropulsionMsg msg, MyNetworkClient sender)
 {
     sync.Entity.Propulsion = msg.Propulsion;
 }
 static void OnChangeStrength(MySyncMotorSuspension sync, ref StrengthMsg msg, MyNetworkClient sender)
 {
     sync.Entity.Strength = msg.Strength;
 }
 static void OnChangeDamping(MySyncMotorSuspension sync, ref DampingMsg msg, MyNetworkClient sender)
 {
     sync.Entity.Damping = msg.Damping;
 }
 static void OnChangeControllable(MySyncMotorSuspension sync, ref SteeringMsg msg, MyNetworkClient sender)
 {
     sync.Entity.Steering = msg.Steering;
 }
Пример #16
0
 static void OnUpdateSlider(MySyncMotorSuspension sync, ref UpdateSliderMsg msg, MyNetworkClient sender)
 {
     switch (msg.Slider)
     {
         case SliderEnum.Height:
             sync.Entity.Height = msg.Value;
             break;
         case SliderEnum.MaxSteerAngle:
             sync.Entity.MaxSteerAngle = msg.Value;
             break;
         case SliderEnum.SteerSpeed:
             sync.Entity.SteerSpeed = msg.Value;
             break;
         case SliderEnum.SteerReturnSpeed:
             sync.Entity.SteerReturnSpeed = msg.Value;
             break;
         case SliderEnum.InvertSteer:
             sync.Entity.InvertSteer = msg.Value > 0;
             break;
         case SliderEnum.SuspensionTravel:
             sync.Entity.SuspensionTravel = msg.Value;
             break;
     }
 }