###概要
Unityで開発したiOSアプリにGameCenterのLeaderBoard機能を追加したいのですが、
実機テストをしても”スコアなし”と出ており(GameCenterログイン、LeaderBoardへのアクセスは出来る)、
ソースコードが悪いのか、ビルド設定が悪いのか、テスト環境が悪いのか分からない状態です。
###状況詳細
使用しているソースコード
GameCenter関連のソースコードは以下
C#
1using UnityEngine; 2using System.Collections; 3using UnityEngine.SocialPlatforms; 4 5public class RankingUtility 6{ 7 8 //ユーザー認証 9 public static void Auth() 10 { 11 // 認証のため ProcessAuthenticationをコールバックとして登録 12 // This call needs to be made before we can proceed to other calls in the Social API 13 Social.localUser.Authenticate(ProcessAuthentication); 14 } 15 16 // 認証が完了した時に呼び出される 17 // 認証が成功した場合、サーバーからのデータがSocial.localUserにセットされている 18 private static void ProcessAuthentication(bool success) 19 { 20 if (success) 21 { 22 Debug.Log("Authenticated, checking achievements"); 23 24 25 } 26 else 27 { 28 Debug.Log("Failed to authenticate"); 29 } 30 } 31 32 // リーダーボードを表示する 33 public static void ShowLeaderboardUI() 34 { 35 Social.ShowLeaderboardUI(); 36 } 37 38 // リーダーボードにスコアを送信する 39 public static void ReportScore(long score) 40 { 41 //このIDは任意の登録したものを使う 42 string leaderboardID = "highscore"; 43 44 Debug.Log("スコア " + HighScore.highscore + " を次の Leaderboard に報告します。" + leaderboardID); 45 46 Social.ReportScore(HighScore.highscore, leaderboardID, success => { 47 48 Debug.Log(success ? "スコア報告は成功しました" : "スコア報告は失敗しました"); 49 }); 50 } 51}
※コードは↓のページのものを改変したものです
http://qiita.com/yimajo/items/503cb2451e303e9f3841
ゲーム画面内にあるランキング呼び出しボタンから、このスクリプトを呼び出している形です
ビルド環境
Unity Cloud Build の iOSプラットフォーム、AdHoc(?)のビルド
ipaをビルドし、iphone6sにインストール
※実機でのプレイは問題無く行えております
GameCenterテスト環境
iTunesConnectにて作成したSandboxテストアカウントにてログイン
あなたの回答
tips
プレビュー