public void SendFontSizeChangeRequest(float FontSize) { ChangeFontSizeMsg msg = new ChangeFontSizeMsg(); msg.EntityId = m_block.EntityId; msg.FontSize = FontSize; Sync.Layer.SendMessageToServer(ref msg, MyTransportMessageEnum.Request); }
static void OnChangeFontSizeSucess(ref ChangeFontSizeMsg msg, MyNetworkClient sender) { MyEntity entity = null; MyEntities.TryGetEntityById(msg.EntityId, out entity); MyTextPanel block = entity as MyTextPanel; if (block != null) { block.FontSize = msg.FontSize; } }
static void OnChangeFontSizeRequest(ref ChangeFontSizeMsg msg, MyNetworkClient sender) { MyEntity entity = null; MyEntities.TryGetEntityById(msg.EntityId, out entity); MyTextPanel block = entity as MyTextPanel; if (block != null) { block.FontSize = msg.FontSize; Sync.Layer.SendMessageToAll(ref msg, MyTransportMessageEnum.Success); } }