public void ReportScore() { if (!GameServiceManager.IsInitialized()) { MobileNativeUI.Alert("Alert", "You need to initialize the module first."); return; } if (selectedLeaderboard == null) { MobileNativeUI.Alert("Alert", "Please select a leaderboard to report score to."); } else { if (string.IsNullOrEmpty(scoreInput.text)) { MobileNativeUI.Alert("Alert", "Please enter a score to report."); } else { int score = System.Convert.ToInt32(scoreInput.text); GameServiceManager.ReportScore(score, selectedLeaderboard.Name); MobileNativeUI.Alert("Alert", "Reported score " + score + " to leaderboard \"" + selectedLeaderboard.Name + "\"."); } } }
/// <summary> /// Reports score to leaderboard. /// </summary> public void ReportScore(int score, string ldbName) { GameServiceManager.ReportScore(score, ldbName); }