コード例 #1
0
ファイル: LotteryPanelScript.cs プロジェクト: YLancer/DN
    public void giftResponse(ClientResponse response)
    {
        //TipsManagerScript.getInstance().setTips("----:" + response.message);
        JsonData data = JsonMapper.ToObject(response.message);

        if (int.Parse(data ["type"].ToString()) == 2)
        {
            TipsManagerScript.getInstance().setTips("抽奖活动暂时没有开放,3秒后将关闭对话框");
            Invoke("closeDialog", 3f);
        }
        else if (int.Parse(data ["type"].ToString()) == 3)
        {
            TipsManagerScript.getInstance().setTips("您今天未玩过游戏还不能抽奖");
            //Invoke ("closeDialog",3f);
        }
        else
        {
            try
            {
                giftDes = JsonMapper.ToObject <GiftList> (response.message);

                if (giftDes.type == "0")  //所有
                                          //ruleText.text = giftDes.data[0].notice;
                {
                    for (int i = 0; i < giftDes.data.Count; i++)
                    {
                        GiftItemVo itemData = giftDes.data [i];
                        lotteryItems [i].nameTxt.text = itemData.prizeName;
                        lotteryItems [i].setPic(itemData.imageUrl);
                    }
                }
            }catch (Exception e) {
                if (GlobalDataScript.loginResponseData.account.prizecount > 0)
                {
                    GlobalDataScript.loginResponseData.account.prizecount--;
                    choujiangNum.text = GlobalDataScript.loginResponseData.account.prizecount + "";
                }
                Drawl returndata = JsonMapper.ToObject <Drawl> (response.message);
                StopIndex = returndata.data;
                MyDebug.Log("StopIndex" + StopIndex);
                if (action == false)
                {
                    float a = UnityEngine.Random.Range(-2, 2f);
                    end = Math.Abs(StopIndex * 36 - 34 + a);
                    MyDebug.Log("end = " + end);
                    x        = 0;
                    action   = true;
                    callBack = true;
                }
            }
        }

        callBack = true;
    }
コード例 #2
0
ファイル: GiftList.cs プロジェクト: greinedt/GiftList
        internal static GiftListEntity GiftList(GiftList ent)
        {
            GiftListEntity data = new GiftListEntity();

            data.giftListId = ent.Id;
            data.personFK = ent.PersonFK;
            data.listName = ent.ListName;
            data.isPrivate = ent.IsPrivate;
            data.updateTimestamp = ent.UpdateTimestamp;
            data.updatePersonFK = ent.UpdatePersonFK;

            return data;
        }
コード例 #3
0
ファイル: GiftList.cs プロジェクト: greinedt/GiftList
        internal static GiftList GiftList(GiftListEntity data)
        {
            GiftList ent = new GiftList();

            ent.Id = data.giftListId;
            ent.PersonFK = data.personFK;
            ent.ListName = data.listName;
            ent.IsPrivate = data.isPrivate;
            ent.UpdateTimestamp = data.updateTimestamp;
            ent.UpdatePersonFK = data.updatePersonFK;

            return ent;
        }
コード例 #4
0
    public void GiftReply(ClientResponse response)
    {
        callBack = true;
        JsonData data = JsonMapper.ToObject <JsonData>(response.message);

        if (int.Parse(data["type"].ToString()) == 2)
        {
            TipsManagerScript.getInstance.setTips(LocalizationManager.GetInstance.GetValue("KEY>11050"));
            Invoke("closeDialog", 3f);
        }
        else
        {
            try
            {
                giftDes = JsonMapper.ToObject <GiftList>(response.message);
                if (giftDes.type == "0")
                {
                    //所有
                    //ruleText.text = giftDes.data[0].notice;
                    for (int i = 0; i < giftDes.data.Count; i++)
                    {
                        GiftItemVo itemData = giftDes.data[i];
                        lotteryItems[i].nameTxt.text = itemData.prizeName;
                        lotteryItems[i].SetPic(itemData.imageUrl);
                    }
                }
            }
            catch (Exception e)
            {
                if (GlobalDataScript.loginResponseData.account.prizecount > 0)
                {
                    GlobalDataScript.loginResponseData.account.prizecount--;
                    choujiangNum.text = GlobalDataScript.loginResponseData.account.prizecount + "";
                }

                Drawl returndata = JsonMapper.ToObject <Drawl>(response.message);
                StopIndex = returndata.data;
                MyDebug.Log("StopIndex" + StopIndex);
                if (!action)
                {
                    float a = UnityEngine.Random.Range(-2, 2f);
                    end = Math.Abs(StopIndex * 36 - 34 + a);
                    MyDebug.Log("end = " + end);
                    x        = 0;
                    action   = true;
                    callBack = true;
                }
            }
        }
    }
コード例 #5
0
    public void giftResponse(ClientResponse response)
    {
        callBack = true;
        JsonData data = JsonMapper.ToObject <JsonData> (response.message);

        if (int.Parse(data ["type"].ToString()) == 2)
        {
            TipsManager.getInstance().setTips("抽奖活动暂时没有开放,3秒后将关闭对话框");
            Invoke("closeDialog", 3f);
        }
        else
        {
            try {
                list = JsonMapper.ToObject <GiftList> (response.message);
                if (list.type == "0")
                {
                    for (int i = 0; i < list.data.Count; i++)
                    {
                        GiftItemVO gvo = list.data [i];
                        lotteryItems [i].setData(gvo);
                    }
                }
            } catch (Exception e) {
                Debug.Log(e.ToString());
                if (GlobalData.getInstance().myAvatarVO.account.prizecount > 0)
                {
                    GlobalData.getInstance().myAvatarVO.account.prizecount--;
                    choujiangNum.text = GlobalData.getInstance().myAvatarVO.account.prizecount + "";
                }
                Drawl returndata = JsonMapper.ToObject <Drawl> (response.message);
                StopIndex = returndata.data;
                MyDebug.Log("StopIndex" + StopIndex);
                if (action == false)
                {
                    float a = UnityEngine.Random.Range(-2, 2f);
                    end = Math.Abs(StopIndex * 36 - 34 + a);
                    MyDebug.Log("end = " + end);
                    x        = 0;
                    action   = true;
                    callBack = true;
                }
            }
        }
    }
コード例 #6
0
 private List <string> RandomGifts(int count)
 {
     return(Rander.RandSort(GiftList.Select(p => p.Name).ToArray()).Take(count).ToList());
 }