I'm following the Cloud Code tutorial that explains how to log race data and show the best lap time.I am now at the point where I want to show the best lap time on the Unity client.I have the following code...
void ShowBestLapTime() { new LogEventRequest().SetEventKey("GET_RACE_DATA") .SetEventAttribute("TRACK", "Track1") .Send(r => { if(r.HasErrors) Debug.LogError("Error getting GET_RACE_DATA : " + r.Errors.GetString("DETAILS")); else { var gsData = new GSData(r.ScriptData); object[] list = gsData.GetObjectList("fastestRaceData").ToArray(); foreach (var l in list) { var dic = (Dictionary<string, object>)l; foreach(var key in dic.Keys) Debug.Log("key = " + key.ToString()); } } }); }
I need to drill down into the 'fastestRaceData' object, to get the value I am looking for.But is there a more efficient/short hand way to access the keys/values in this 'fastestRaceData' object than incrementing through a list?Thanks
Never mind lol, late night for me last night :)This is what I've found is the most efficient to code...
var gsData = new GSData(r.ScriptData);
object[] list = gsData.GetObjectList("fastestRaceData").ToArray();
foreach (var l in list)
{
var dic = (Dictionary<string, object>)l;
string timeTkane = dic["timeTaken"].ToString();
}
Greg Quinn
I'm following the Cloud Code tutorial that explains how to log race data and show the best lap time.
I am now at the point where I want to show the best lap time on the Unity client.
I have the following code...
I need to drill down into the 'fastestRaceData' object, to get the value I am looking for.
But is there a more efficient/short hand way to access the keys/values in this 'fastestRaceData' object than incrementing through a list?
Thanks
Never mind lol, late night for me last night :)
This is what I've found is the most efficient to code...
var gsData = new GSData(r.ScriptData);
object[] list = gsData.GetObjectList("fastestRaceData").ToArray();
foreach (var l in list)
{
var dic = (Dictionary<string, object>)l;
string timeTkane = dic["timeTaken"].ToString();
}
Greg Quinn
Never mind lol, late night for me last night :)
This is what I've found is the most efficient to code...
var gsData = new GSData(r.ScriptData);
object[] list = gsData.GetObjectList("fastestRaceData").ToArray();
foreach (var l in list)
{
var dic = (Dictionary<string, object>)l;
string timeTkane = dic["timeTaken"].ToString();
}
-
Documentation Notes
-
Design issues with user events
-
Using NoSQL
-
Runtime Collections vs Metadata Collections
-
Anonymous authentication from browser app
-
Modules
-
Movement With Unity
-
Problem with url parameters for downloadables
-
Querying NoSql GameSparks database
-
Challenge accesType
See all 2487 topics