Esempio n. 1
0
    /// <summary>
    ///  上传得分
    /// </summary>
    /// <param name="score">游戏得分</param>
    /// <param name="leaderboardId">排行榜id,此数据在开发者网站获取</param>
    /// <param name="obj">MonoBehaviour子类对象</param>
    /// <param name="callbackMethod">监听事件响应</param>
    public static void ReportScore(int score, string leaderboardId, MonoBehaviour obj, KTPlayLeaderboard.Callback callbackMethod)
    {
#if UNITY_ANDROID
        KTLeaderboardAndroid.ReportScore(score, leaderboardId, obj, callbackMethod);
#elif UNITY_IOS
        KTLeaderboardiOS.ReportScore(score, leaderboardId, obj, callbackMethod);
#else
#endif
    }
Esempio n. 2
0
    /// <summary>
    ///  获取上周游戏排行榜数据
    /// </summary>
    /// <param name="leaderboardId">排行榜id,此数据在开发者网站获取</param>
    /// <param name="startIndex">排行榜起始位置,如果传-1 返回当前登录用户排名所处位置的排行榜数据</param>
    /// <param name="count">获取排行榜数据记录条数</param>
    /// <param name="obj">MonoBehaviour子类对象</param>
    /// <param name="callbackMethod">监听事件响应</param>
    public static void LastGlobalLeaderboard(string leaderboardId, int startIndex, int count, MonoBehaviour obj, KTPlayLeaderboard.Callback callbackMethod)
    {
#if UNITY_ANDROID
        KTLeaderboardAndroid.LastGlobalLeaderboard(leaderboardId, startIndex, count, obj, callbackMethod);
#elif UNITY_IOS
        KTLeaderboardiOS.LastGlobalLeaderboard(leaderboardId, startIndex, count, obj, callbackMethod);
#else
#endif
    }
Esempio n. 3
0
 public static void ReportScore(int score, string leaderboardId, MonoBehaviour obj, KTPlayLeaderboard.Callback callbackMethod)
 {
     if (obj != null && callbackMethod != null)
     {
         GameObject gameObj = obj.gameObject;
         if (gameObj != null && callbackMethod != null)
         {
             string methodName = ((System.Delegate)callbackMethod).Method.Name;
             if (methodName != null)
             {
                 KT_ReportScoreCallback(gameObj.name, methodName, score, leaderboardId);
             }
         }
     }
 }
Esempio n. 4
0
 public static void LastGlobalLeaderboard(string leaderboardId, int startIndex, int count, MonoBehaviour obj, KTPlayLeaderboard.Callback callbackMethod)
 {
     if (obj != null && callbackMethod != null)
     {
         GameObject gameObj = obj.gameObject;
         if (gameObj != null && callbackMethod != null)
         {
             string methodName = ((System.Delegate)callbackMethod).Method.Name;
             if (methodName != null)
             {
                 KT_LastGlobalLeaderBoardCallback(gameObj.name, methodName, leaderboardId, startIndex, count);
             }
         }
     }
 }
Esempio n. 5
0
    public static void FriendsLeaderBoard(string leaderboardId, int startIndex, int count, MonoBehaviour obj, KTPlayLeaderboard.Callback callbackMethod)
    {
        if (obj != null && callbackMethod != null)
        {
            GameObject gameObj = obj.gameObject;
            if (gameObj != null && callbackMethod != null)
            {
                string methodName = ((System.Delegate)callbackMethod).Method.Name;
                if (methodName != null)
                {
#if UNITY_ANDROID
                    KTPlayAndroid.joKTPlayAdapter.CallStatic("friendsLeaderboard", leaderboardId, startIndex, count, gameObj.name, methodName);
#endif
                }
            }
        }
    }
Esempio n. 6
0
    public static void ReportScore(long score, string leaderboardId, MonoBehaviour obj, KTPlayLeaderboard.Callback callbackMethod)
    {
        if (obj != null && callbackMethod != null)
        {
            GameObject gameObj = obj.gameObject;
            if (gameObj != null && callbackMethod != null)
            {
                string methodName = ((System.Delegate)callbackMethod).Method.Name;
                if (methodName != null)
                {
#if UNITY_ANDROID
                    KTPlayAndroid.joKTPlayAdapter.CallStatic("reportScore", score, leaderboardId, gameObj.name, methodName);
#endif
                }
            }
        }
    }
Esempio n. 7
0
 public static void RequestGameLeaderboard(GameSystem.Mode mode, GameSystem.ModeType modeType, MonoBehaviour target, KTPlayLeaderboard.Callback callback, int startIndex = 0)
 {
     if (Application.platform == RuntimePlatform.IPhonePlayer || Application.platform == RuntimePlatform.Android)
     {
         string leaderboardId = LeaderboardIDs[(int)mode][(int)modeType];
         Debug.Log("request leaderboard ID of game:" + leaderboardId);
         KTPlayLeaderboard.GlobalLeaderboard(leaderboardId, startIndex, Constant.TOP_RANK_COUNT, target, callback);
     }
 }