I am using Unity and Gamesparks. I am getting a Gamesparks object return but I am unable to access the data inside using C#.
private void OnScriptMessage(ScriptMessage message)
{
switch (message.ExtCode)
{
case "EndTurnMessage":
{
var data = message.Data;
string playerID = data.GetString("playerID");
print(message.JSONString);
break;
}
print(message.JSONString); displays
{"@class":".ScriptMessage","data":{"player":{"status":"win","choice":"scissors","newScore":1},"opponent":{"status":"lost","choice":"paper","newScore":0}},"extCode":"roundWonMessage","messageId":"5c74b1a8bcb1b604f0275ed5","notification":true,"playerId":"5c5b5823642c55481643846d","summary":"ScriptMessage"}
UnityEngine.MonoBehaviour:print(Object)
I wish to get newScore etc but I am confused with C# JSON

etcdo you need only one value or a complete representation of the json as class(es)?