文档

Unity Engine

Unity Engine

ReportScore(long, string, Action<bool>)

Report a score to a specific leaderboard.
阅读时间1 分钟最后更新于 1 个月前

Definition

  • Type: Method
  • Namespace: UnityEngine
  • Assembly: UnityEngine.GameCenterModule
警告
Deprecated. Social is deprecated and will be removed in a future release.
public static void ReportScore(long score, string board, Action<bool> callback)

Parameters

score


board


callback

Examples

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