Skip to content

Instantly share code, notes, and snippets.

@LuckOfWise
Last active December 17, 2015 14:39
Show Gist options
  • Save LuckOfWise/5625956 to your computer and use it in GitHub Desktop.
Save LuckOfWise/5625956 to your computer and use it in GitHub Desktop.
UnityからSCORE BOARD(http://www.score-board.mobi/)を使う場合 AndroidManifest.xmlはREADME.txtを見て更新してください。
// スコアの送信
void PostRanking (int score)
{
#if UNITY_ANDROID
AndroidJavaClass plugin = new AndroidJavaClass ("jp.basicinc.gamefeat.ranking.android.sdk.controller.GFRankingController");
AndroidJavaClass unityPlayer = new AndroidJavaClass ("com.unity3d.player.UnityPlayer");
AndroidJavaObject activity = unityPlayer.GetStatic<AndroidJavaObject> ("currentActivity");
AndroidJavaObject ranking = plugin.CallStatic<AndroidJavaObject> ("getIncetance", activity);
ranking.Call ("sendScore", new string[] {"[ゲームモードID]"}, new string[] { score.ToString()});
#endif
}
// ランキングページ表示
void ShowRanking ()
{
#if UNITY_ANDROID
AndroidJavaClass plugin = new AndroidJavaClass ("jp.basicinc.gamefeat.ranking.android.sdk.controller.GFRankingController");
AndroidJavaClass unityPlayer = new AndroidJavaClass ("com.unity3d.player.UnityPlayer");
AndroidJavaObject activity = unityPlayer.GetStatic<AndroidJavaObject> ("currentActivity");
plugin.CallStatic ("show", activity, "[ゲームモードID]");
#endif
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment