Exemplo n.º 1
0
 private GuiComponent CreateEditField(MarshalComponentParameter compPar)
 {
     if (compPar.Parameter.ParameterType == typeof (float) || compPar.Parameter.ParameterType == typeof (int) ||
         compPar.Parameter.ParameterType == typeof (String))
     {
         var editTxt = new Textbox(100, _resourceManager);
         editTxt.ClearOnSubmit = false;
         editTxt.UserData = compPar;
         editTxt.Text = compPar.Parameter.Parameter.ToString();
         editTxt.OnSubmit += editTxt_OnSubmit;
         return editTxt;
     }
     else if (compPar.Parameter.ParameterType == typeof (Boolean))
     {
         var editBool = new Checkbox(_resourceManager);
         editBool.UserData = compPar;
         editBool.Value = ((Boolean) compPar.Parameter.Parameter);
         editBool.ValueChanged += editBool_ValueChanged;
         return editBool;
     }
     return null;
 }
 /// <summary>
 /// Sends an SVar to the server to be set on the server-side entity.
 /// </summary>
 /// <param name="sendingEntity"></param>
 /// <param name="svar"></param>
 public void SendSVar(Entity sendingEntity, MarshalComponentParameter svar)
 {
     NetOutgoingMessage message = CreateEntityMessage();
     message.Write((byte)EntityMessage.SetSVar);
     message.Write(sendingEntity.Uid);
     svar.Serialize(message);
     _networkManager.SendMessage(message, NetDeliveryMethod.ReliableUnordered);
 }
Exemplo n.º 3
0
 public void DoSetSVar(MarshalComponentParameter svar)
 {
     Owner.SendComponentNetworkMessage(this, NetDeliveryMethod.ReliableUnordered, ComponentMessageType.SetSVar,
                                       svar.Serialize());
 }