コード例 #1
0
 private static void OnSwitchCharacterModel(MySyncCharacter sync, ref SwitchCharacterModelMsg msg, MyNetworkClient sender)
 {
     if (sync.ResponsibleForUpdate(sender))
     {
         var handler = sync.CharacterModelSwitched;
         if (handler != null)
         {
             handler(msg.Model, msg.ColorMaskHSV);
         }
     }
 }
コード例 #2
0
        public void ChangeCharacterModelAndColor(string model, Vector3 colorMaskHSV)
        {
            if (ResponsibleForUpdate(this))
            {
                var msg = new SwitchCharacterModelMsg();
                msg.CharacterEntityId = Entity.EntityId;
                msg.Model             = model;
                msg.ColorMaskHSV      = colorMaskHSV;

                Sync.Layer.SendMessageToAllAndSelf(ref msg);
            }
        }
コード例 #3
0
 private static void OnSwitchCharacterModel(MySyncCharacter sync, ref SwitchCharacterModelMsg msg, MyNetworkClient sender)
 {
     if (Sync.IsServer && sync.ResponsibleForUpdate(sender))
     {
         var handler = sync.CharacterModelSwitched;
         if (handler != null)
         {
             handler(msg.Model, msg.ColorMaskHSV);
         }
         Sync.Layer.SendMessageToAllButOne(ref msg, sender.SteamUserId);
     }
     else if (sender.SteamUserId == Sync.ServerId || sender.SteamUserId == Sync.MyId)
     {
         var handler = sync.CharacterModelSwitched;
         if (handler != null)
         {
             handler(msg.Model, msg.ColorMaskHSV);
         }
     }
 }
コード例 #4
0
 private static void OnSwitchCharacterModel(MySyncCharacter sync, ref SwitchCharacterModelMsg msg, MyNetworkClient sender)
 {
     if (Sync.IsServer && sync.ResponsibleForUpdate(sender))
     {
         var handler = sync.CharacterModelSwitched;
         if (handler != null)
         {
             handler(msg.Model, msg.ColorMaskHSV);
         }
         Sync.Layer.SendMessageToAllButOne(ref msg, sender.SteamUserId);
     }
     else if (sender.SteamUserId == Sync.ServerId || sender.SteamUserId == Sync.MyId)
     {
         var handler = sync.CharacterModelSwitched;
         if (handler != null)
             handler(msg.Model, msg.ColorMaskHSV);
     }
 }
コード例 #5
0
        public void ChangeCharacterModelAndColor(string model, Vector3 colorMaskHSV)
        {
            if (ResponsibleForUpdate(this))
            {
                var msg = new SwitchCharacterModelMsg();
                msg.CharacterEntityId = Entity.EntityId;
                msg.Model = model;
                msg.ColorMaskHSV = colorMaskHSV;

                Sync.Layer.SendMessageToServerAndSelf(ref msg);
            }
        }
コード例 #6
0
 private static void OnSwitchCharacterModel(MySyncCharacter sync, ref SwitchCharacterModelMsg msg, MyNetworkClient sender)
 {
     if (sync.ResponsibleForUpdate(sender))
     {
         var handler = sync.CharacterModelSwitched;
         if (handler != null)
             handler(msg.Model, msg.ColorMaskHSV);
     }
 }