void OnClickSingleRanking()
    {
        // 다중 클릭 막음
        buttonSingleRanking.interactable = false;

        var singleRankingReq = new Com.Nhn.Gameanvil.Sample.Protocol.ScoreRankingReq
        {
            Start = 1,
            End   = 100
        };

        Debug.Log("singleRankingReq " + singleRankingReq);

        // ===========================================================================================>>> GameAnvil
        // 싱글 랭킹 요청
        gameUser.Request <Com.Nhn.Gameanvil.Sample.Protocol.ScoreRankingRes>(singleRankingReq, (userAgent, singleRankingRes) =>
        {
            Debug.Log("singleRankingRes" + singleRankingRes);

            if (singleRankingRes.ResultCode == Com.Nhn.Gameanvil.Sample.Protocol.ErrorCode.None)
            {
                // 성공시 랭킹 처리
            }
            else
            {
                // 실패시 처리
            }
            buttonSingleRanking.interactable = true;
        });
        // ===========================================================================================>>> GameAnvil
    }
예제 #2
0
    void OnClickSingleRanking()
    {
        // 다중 클릭 막음
        buttonSingleRanking.interactable = false;

        var singleRankingReq = new Com.Nhn.Gameanvil.Sample.Protocol.ScoreRankingReq
        {
            Start = 1,
            End   = 100
        };

        Debug.Log("singleRankingReq " + singleRankingReq);

        // ===========================================================================================>>> GameAnvil
        // 게임에서 등록한 랭킹 리스트 요청
        gameUser.Request <Com.Nhn.Gameanvil.Sample.Protocol.ScoreRankingRes>(singleRankingReq, (userAgent, singleRankingRes) =>
        {
            Debug.Log("singleRankingRes" + singleRankingRes);

            if (singleRankingRes.ResultCode == Com.Nhn.Gameanvil.Sample.Protocol.ErrorCode.None)
            {
                var rankings = singleRankingRes.Rankings;

                textRanking.text  = "RankingList";
                int rankingNumber = 0;
                foreach (var ranking in rankings)
                {
                    textRanking.text += "\n" + rankingNumber++ + ":" + ":" + ranking.Nickname + ":" + ranking.Score;
                }

                panelSingleRankingInfo.SetActive(true);
            }
            else
            {
                // 실패시 처리
                MessageUi.Instance.SetTextMessage("singleRankingReq  Fail..... " + singleRankingRes);
            }
            buttonSingleRanking.interactable = true;
        });
        // ===========================================================================================>>> GameAnvil
    }