void SelectChallenge(GKScoreChallenge challenge) { string leaderboardID = challenge.Score.LeaderboardIdentifier; string[] substrings = leaderboardID.Split('.'); string leaderboardSubstring = substrings [substrings.Length - 1]; string timeString = leaderboardSubstring.Substring(0, 9); string modeString = leaderboardSubstring.Substring(9); switch (timeString) { case "15seconds": GameInfo.GameTime = GameTime.Fifteen; break; case "30seconds": GameInfo.GameTime = GameTime.Thirty; break; case ("45seconds"): GameInfo.GameTime = GameTime.FourtyFive; break; default: GameInfo.GameTime = GameTime.Max; break; } GameInfo.GameMode = modeString == "hardmode" ? GameMode.Hard : GameMode.Easy; GameInfo.Challenge = challenge; playChallengeButton.Hidden = false; }
void SelectChallenge (GKScoreChallenge challenge) { string leaderboardID = challenge.Score.LeaderboardIdentifier; string[] substrings = leaderboardID.Split ('.'); string leaderboardSubstring = substrings [substrings.Length - 1]; string timeString = leaderboardSubstring.Substring (0, 9); string modeString = leaderboardSubstring.Substring (9); switch (timeString) { case "15seconds": GameInfo.GameTime = GameTime.Fifteen; break; case "30seconds": GameInfo.GameTime = GameTime.Thirty; break; case ("45seconds"): GameInfo.GameTime = GameTime.FourtyFive; break; default: GameInfo.GameTime = GameTime.Max; break; } GameInfo.GameMode = modeString == "hardmode" ? GameMode.Hard : GameMode.Easy; GameInfo.Challenge = challenge; playChallengeButton.Hidden = false; }