I want to send some part of class to server.
sending Info
[Serializable]
public class SendingInfos
{
public string tempID;
public string playerLettersInHand;
public string playerLettersMiddle;
public int playerBet;
public string playerLetterSent;
}
currently temID and playerBet has value while rest of them null.In this case, if i use
string jsondata = JsonUtility.ToJson(sendingInfos);
this and send it. Do i send the part of class which isnt null or all of it? Is there any other option to send part of it? like
string jsondata = JsonUtility.ToJson({ sendingInfos.tempID, sendingInfos.playerBet });
Edit: the reason i want to send somepart of class to server is,to keep server network traffic at low as much as possible. Also, i might do this by dividing the class to 2 class.however if there is , easier way , i want to do that.