示例#1
0
        private static void OnAttachRotor(MySyncMotorStator block, ref AttachRotorMsg msg, MyNetworkClient sender)
        {
            MyMotorStator stator = (MyMotorStator)block.Entity;

            stator.AttachRotor();
            if (Sync.IsServer)
            {
                Sync.Layer.SendMessageToAll(ref msg);
            }
        }
示例#2
0
        private static void OnChangeStatorMaxAngle(MySyncMotorStator block, ref ChangeStatorMaxAngleMsg msg, MyNetworkClient sender)
        {
            MyMotorStator stator = (MyMotorStator)block.Entity;

            stator.MaxAngle = msg.MaxAngleNormalized;
            if (Sync.IsServer)
            {
                Sync.Layer.SendMessageToAll(ref msg);
            }
        }
示例#3
0
        private static void OnChangeStatorTargetVelocity(MySyncMotorStator block, ref ChangeStatorTargetVelocityMsg msg, MyNetworkClient sender)
        {
            MyMotorStator stator = (MyMotorStator)block.Entity;

            stator.TargetVelocity = msg.TargetVelocity;
            if (Sync.IsServer)
            {
                Sync.Layer.SendMessageToAll(ref msg);
            }
        }
示例#4
0
        private static void OnChangeStatorBrakingTorque(MySyncMotorStator block, ref ChangeStatorBrakingTorqueMsg msg, MyNetworkClient sender)
        {
            MyMotorStator stator = (MyMotorStator)block.Entity;

            stator.BrakingTorque = msg.BrakingTorque;
            if (Sync.IsServer)
            {
                Sync.Layer.SendMessageToAll(ref msg);
            }
        }
示例#5
0
        private static void OnChangeRotorDisplacement(MySyncMotorStator sync, ref SetRotorDisplacementMsg msg, MyNetworkClient sender)
        {
            MyMotorStator stator = (MyMotorStator)sync.Entity;

            stator.DummyDisplacement = msg.Displacement;

            if (Sync.IsServer)
            {
                Sync.Layer.SendMessageToAll(ref msg);
            }
        }
 private static void OnAttachRotor(MySyncMotorStator block, ref AttachRotorMsg msg, MyNetworkClient sender)
 {
     MyMotorStator stator = (MyMotorStator)block.Entity;
     stator.AttachRotor();
     if (Sync.IsServer)
     {
         Sync.Layer.SendMessageToAll(ref msg);
     }
 }
 static void OnSetCurrentAngle(MySyncMotorStator sync, ref SetCurrentAngleMsg msg, MyNetworkClient sender)
 {
     sync.SetAngle(msg.CurrentAngle);
 }
        private static void OnChangeRotorDisplacement(MySyncMotorStator sync, ref SetRotorDisplacementMsg msg, MyNetworkClient sender)
        {
            MyMotorStator stator = (MyMotorStator)sync.Entity;
            stator.DummyDisplacement = msg.Displacement;

            if (Sync.IsServer)
            {
                Sync.Layer.SendMessageToAll(ref msg);
            }
        }
 private static void OnChangeStatorMaxAngle(MySyncMotorStator block, ref ChangeStatorMaxAngleMsg msg, MyNetworkClient sender)
 {
     MyMotorStator stator = (MyMotorStator)block.Entity;
     stator.MaxAngle = msg.MaxAngleNormalized;
     if (Sync.IsServer)
         Sync.Layer.SendMessageToAll(ref msg);
 }
示例#10
0
 private static void OnChangeStatorTargetVelocity(MySyncMotorStator block, ref ChangeStatorTargetVelocityMsg msg, MyNetworkClient sender)
 {
     MyMotorStator stator = (MyMotorStator)block.Entity;
     stator.TargetVelocity = msg.TargetVelocity;
     if (Sync.IsServer)
         Sync.Layer.SendMessageToAll(ref msg);
 }
示例#11
0
 private static void OnChangeStatorBrakingTorque(MySyncMotorStator block, ref ChangeStatorBrakingTorqueMsg msg, MyNetworkClient sender)
 {
     MyMotorStator stator = (MyMotorStator)block.Entity;
     stator.BrakingTorque = msg.BrakingTorque;
     if (Sync.IsServer)
         Sync.Layer.SendMessageToAll(ref msg);
 }
示例#12
0
 protected override MySyncEntity OnCreateSync()
 {
     var sync = new MySyncMotorStator(this);
     sync.SetAngle = SyncAngle;
     return sync;
 }
示例#13
0
 static void OnSetCurrentAngle(MySyncMotorStator sync, ref SetCurrentAngleMsg msg, MyNetworkClient sender)
 {
     sync.SetAngle(msg.CurrentAngle);
 }