Report a score to a specific leaderboard.
#pragma strict function ReportScore(score, leaderboardID) { Debug.Log("Reporting score " + score + " on leaderboard " + leaderboardID); Social.ReportScore(score, leaderboardID, function(success) { Debug.Log(success ? "Reported score successfully" : "Failed to report score"); } ); }
using UnityEngine; using UnityEngine.SocialPlatforms; using System.Collections;
public class ExampleClass : MonoBehaviour { void ReportScore (long score, string leaderboardID) { Debug.Log ("Reporting score " + score + " on leaderboard " + leaderboardID); Social.ReportScore (score, leaderboardID, success => { Debug.Log(success ? "Reported score successfully" : "Failed to report score"); }); } }