Ejemplo n.º 1
0
 void AfterComplete(BaseHttpRequest request, BaseResponse response)
 {
     if (response != null && response.status != BaseResponse.ERROR)
     {
         HttpRequest httprequest = request as HttpRequest;
         if (httprequest.Act == HttpRequestFactory.ACTION_GET_CHALLENGE_RANK)
         {
             GetChallengeRankResponse res = response as GetChallengeRankResponse;
             if (res != null)
             {
                 CreateRobCell(res);
                 _Grid.Reposition();
             }
         }
         else if (httprequest.Act == HttpRequestFactory.ACTION_GET_TIANXIADIYI_RANK)
         {
             GetChallengeRankResponse res = response as GetChallengeRankResponse;
             if (res != null)
             {
                 TianXiaCell(res);
                 _Grid.Reposition();
             }
         }
         ComLoading.Close();
     }
     else if (response != null && response.status == BaseResponse.ERROR)
     {
         SQYAlertViewMove.CreateAlertViewMove(Core.Data.stringManager.getNetworkErrorString(response.errorCode));
     }
 }
Ejemplo n.º 2
0
    void CreateRobCell(GetChallengeRankResponse res)
    {
        GameObject obj1 = PrefabLoader.loadFromPack("LS/pbLSChallengeRankCell") as GameObject;

        if (obj1 != null)
        {
            for (int i = 0; i < res.data.list.Length; i++)
            {
                GameObject go = NGUITools.AddChild(_Grid.gameObject, obj1);
                go.gameObject.name = (1000 + i).ToString();
                UIChallengeRankCell mm = go.gameObject.GetComponent <UIChallengeRankCell>();
                mm.OnShow(res.data.list[i], i + 1);
                _UIChallengeRankCelList.Add(mm);
            }
            if (res.data.list.Length < 7)
            {
                _ScrollView.disableDragIfFits = true;
            }
            else
            {
                _ScrollView.disableDragIfFits = false;
            }
        }
    }