Ejemplo n.º 1
0
    public int GetCurrentPlayerRank(UM_Leaderboard leaderboard)
    {
        switch (Application.platform)
        {
        case RuntimePlatform.IPhonePlayer:
            GCLeaderBoard board = GameCenterManager.GetLeaderBoard(leaderboard.IOSId);
            if (board != null)
            {
                return(board.GetCurrentPlayerScore(GCBoardTimeSpan.ALL_TIME, GCCollectionType.GLOBAL).rank);
            }
            else
            {
                return(0);
            }

        case RuntimePlatform.Android:
            GPLeaderBoard gBoard = GooglePlayManager.instance.GetLeaderBoard(leaderboard.AndroidId);
            if (gBoard != null)
            {
                return(gBoard.GetCurrentPlayerScore(GPBoardTimeSpan.ALL_TIME, GPCollectionType.GLOBAL).rank);
            }
            else
            {
                return(0);
            }
        }

        return(0);
    }