var lastAfkStatReq = server.GetPlayerStatistics({ PlayFabId: currentPlayerId, StatisticNames: ["LastLoginTime"] }); var lastAfkStat = lastAfkStatReq.Statistics; var LastLoginTime = 0; for (var key in lastAfkStat) { if (lastAfkStat[key].StatisticName == "LastLoginTime") { oldTime = lastAfkStat[key].Value; } }
The following code does return the value I'm looking for from my players statistics, returning:
{"oldTime":1234}
from the client code
void OnCloudUpdateStatistics(ExecuteCloudScriptResult result) { Debug.Log(PlayFabSimpleJson.SerializeObject(result.FunctionResult)); }
but how can I treat the above number as an integer in unity? The loop above does trim the other values in the array of items, but I just need the integer.