Social.ReportScore

Unity · Версия 2020.3 LTS · Scripting · Social

Social.ReportScore

Объявление

public static void ReportScore(long score, string board, Action 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");
        });
    }
}

Обновлено 17 ноября 2026 г.