Hi,
I'm following the example learning the get statistic function. The error message pops out: "the name 'eachStat' does not exist in current context." The switch state's eachStat cannot refer to var eachStat. What am I missing here.
void GetStats() {
PlayFabClientAPI.GetPlayerStatistics( new GetPlayerStatisticsRequest(), OnGetStats, error => Debug.LogError(error.GenerateErrorReport()) );
}
void OnGetStats(GetPlayerStatisticsResult result) {
Debug.Log("Received the following Statistics:");
foreach (var eachStat in result.Statistics)
Debug.Log("Statistic (" + eachStat.StatisticName + "): " + eachStat.Value);
switch(eachStat.StatisticName) { case "playerLevel": playerLevel = eachStat.Value; break; case "gameLevel": gameLevel = eachStat.Value; break; case "playerHealth": playerHealth = eachStat.Value; break; case "playerDamage": playerDamage = eachStat.Value; break; case "playerhighScore": playerhighScore = eachStat.Value; break; }