new LogEventRequest().SetEventKey("LOAD_CARD1").Send((response) => {
if (!response.HasErrors)
{
//getting the ScriptData JSON
GSData data = response.ScriptData.GetGSData("response_Card1");
//Extracting values one by one
string name = data.GetGSData("Card1").GetString("Name"));
}
});
and it works fine.
But there are a lot of key-value pairs (and there will be 15 cards all with those keys each) in the response and getting all of them individually doesn't seem like the most performance-friendly option.
Idealy I would like to store them all in a array/list/dictionary but all the answers I found on the forum deal with GetObjectList which is now deprecated.
Can anyone help me with a solution to this please? :)
Many thanks!!
1 Comment
Customer Support
said
about 6 years ago
Hi Alex,
I believe this Unity guide should be useful for you here. If you have any further questions on the GameSparks side just let us know.
Alex Catana
Hello,
I am trying to retrieve the data from a scriptData in a LogEventRequest response in Unity. It is set to return the below:
This is my code:
and it works fine.
But there are a lot of key-value pairs (and there will be 15 cards all with those keys each) in the response and getting all of them individually doesn't seem like the most performance-friendly option.
Idealy I would like to store them all in a array/list/dictionary but all the answers I found on the forum deal with GetObjectList which is now deprecated.
Can anyone help me with a solution to this please? :)
Many thanks!!