ドキュメント

​
​

Development

User Acquisition

Monetization

産業

Leaderboards

Unity SDK

Admin API

Client API

Open Unity Dashboard

Leaderboards

このページは選択した言語では使用できません。
LiveOps
​
​
Leaderboards
  • Overview
  • Get started
  • Concepts
  • Tutorials
    • Configuration
    • Unity SDK tutorial
      • Add a new score
      • Get the player's score
      • Get scores
      • Get a range of scores centered around the player
      • Get scores for other players
      • Get scores for a certain tier
      • Get a list of available leaderboard versions
      • Get the player's score from a leaderboard version
      • Get scores from a leaderboard version
      • Get a range of scores centered around the player from a leaderboard version
      • Get scores for other players from a leaderboard version
      • Get scores for a certain tier from a leaderboard version
    • Unity SDK sample
    • Cloud Code samples
  • Reference
  • Privacy and consent
  1. Leaderboards
  2. Unity SDK tutorial

Add a new score

Add or update a score for a player in a leaderboard.
読み終わるまでの所要時間 1 分
最終更新 7日前

To add or update an entry for the player in the specified leaderboard, use the
AddPlayerScoreAsync
method.
public async void AddScore(string leaderboardId, int score) { var playerEntry = await LeaderboardsService.Instance .AddPlayerScoreAsync(leaderboardId, score); Debug.Log(JsonConvert.SerializeObject(playerEntry)); }

Add a new score with metadata

To add a score with metadata, use the
Metadata
option on the
AddPlayerScoreOptions
configuration object:
[Serializable] public class ScoreMetadata { public string levelName; public int timeTaken; } public async void AddScoreWithMetadata(string leaderboardId, int score) { var scoreMetadata = new ScoreMetadata { levelName = "LEVEL_01", timeTaken = 120 }; var playerEntry = await LeaderboardsService.Instance .AddPlayerScoreAsync( leaderboardId, score, new AddPlayerScoreOptions { Metadata = scoreMetadata } ); Debug.Log(JsonConvert.SerializeObject(playerEntry)); }
If a score that has stored metadata is updated with null metadata, the new metadata value will be null.
Leaderboard score metadata can be up to 1024 bytes (1 KB).

Copyright © 2026 Unity Technologies
法規事項プライバシーポリシークッキーDocumentation Terms of Use私の個人情報を販売または共有しないプライバシーに関する選択 (クッキー設定)

"Unity" の名称、Unity のロゴ、およびその他の Unity の商標は、米国およびその他の国における Unity Technologies またはその関係会社の商標または登録商標です (詳しくはこちら)。その他の名称またはブランドは該当する所有者の商標です。

一部のページは利便性向上のため機械翻訳を使用しており、内容に不正確な表現が含まれる場合があります。内容に齟齬または不一致が生じた場合は、英語版を正本とします。

  • このページ
    • Add a new score with metadata


このページの問題を報告する