Select your preferred scripting language. All code snippets will be displayed in this language.
Thank you for helping us improve the quality of Unity Documentation. Although we cannot accept all submissions, we do read each suggested change from our users and will make updates where applicable.
CloseReport a score to a specific leaderboard.
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"); }); } }