private static void SelectGame(int index, Settings ga, int platform) { ga.SelectedGame[platform] = index; if(index == 0) { ga.UpdateGameKey(platform, ""); ga.UpdateSecretKey(platform, ""); } else if(ga.IsGameKeyValid(platform, ga.Studios[ga.SelectedStudio[platform] - 1].Games[index - 1].GameKey) && ga.IsSecretKeyValid(platform, ga.Studios[ga.SelectedStudio[platform] - 1].Games[index - 1].SecretKey)) { ga.SelectedPlatformStudio[platform] = ga.Studios[ga.SelectedStudio[platform] - 1].Name; ga.SelectedPlatformGame[platform] = ga.Studios[ga.SelectedStudio[platform] - 1].Games[index - 1].Name; ga.SelectedPlatformGameID[platform] = ga.Studios[ga.SelectedStudio[platform] - 1].Games[index - 1].ID; ga.UpdateGameKey(platform, ga.Studios[ga.SelectedStudio[platform] - 1].Games[index - 1].GameKey); ga.UpdateSecretKey(platform, ga.Studios[ga.SelectedStudio[platform] - 1].Games[index - 1].SecretKey); SetLoginStatus("Received keys. Ready to go!", ga); } else { if(!ga.IsGameKeyValid(platform, ga.Studios[ga.SelectedStudio[platform] - 1].Games[index - 1].GameKey)) { Debug.LogError("[GameAnalytics] Game key already exists for another platform. Platforms can't use the same key."); ga.SelectedGame[platform] = 0; } else if(!ga.IsSecretKeyValid(platform, ga.Studios[ga.SelectedStudio[platform] - 1].Games[index - 1].SecretKey)) { Debug.LogError("[GameAnalytics] Secret key already exists for another platform. Platforms can't use the same key."); ga.SelectedGame[platform] = 0; } } }
private static void SelectStudio(int index, Settings ga, int platform) { ga.SelectedStudio[platform] = index; if(ga.Studios[index - 1].Games.Count == 1) { if(ga.IsGameKeyValid(platform, ga.Studios[ga.SelectedStudio[platform] - 1].Games[0].GameKey) && ga.IsSecretKeyValid(platform, ga.Studios[ga.SelectedStudio[platform] - 1].Games[0].SecretKey)) { SelectGame(1, ga, platform); } } else { SetLoginStatus("Please select game..", ga); } }