Version: 2021.1

Social.ReportScore

切换到手册
public static void ReportScore (long score, string board, Action<bool> callback);

描述

向特定排行榜报告分数。

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"); }); } }