Esempio n. 1
0
    private void UpdateBtnInfo()
    {
        LuckDrawManager.Instance.lastSelectMode = 5;
        int lastSelectMode = LuckDrawManager.Instance.lastSelectMode;
        ChouJiangXiaoHao chouJiangXiaoHao = DataReader <ChouJiangXiaoHao> .Get(LuckDrawManager.Instance.lastSelectMode);

        ChouJiangXiaoHao chouJiangXiaoHao2 = DataReader <ChouJiangXiaoHao> .Get(LuckDrawManager.Instance.lastSelectMode + 1);

        if (BackpackManager.Instance.OnGetGoodCount(chouJiangXiaoHao.lotteryId) >= (long)chouJiangXiaoHao.lotteryAmount || lastSelectMode == 1)
        {
            this.LuckyNum1.set_text(BackpackManager.Instance.OnGetGoodCount(chouJiangXiaoHao.lotteryId) + "/" + chouJiangXiaoHao.lotteryAmount);
            ResourceManager.SetSprite(this.LuckyItemIcon1, GameDataUtils.GetIcon(DataReader <Items> .Get(chouJiangXiaoHao.lotteryId).littleIcon));
        }
        else
        {
            this.LuckyNum1.set_text("x" + chouJiangXiaoHao.amount.ToString());
            ResourceManager.SetSprite(this.LuckyItemIcon1, GameDataUtils.GetIcon(DataReader <Items> .Get(chouJiangXiaoHao.itemId).littleIcon));
        }
        if (lastSelectMode == 1 || (chouJiangXiaoHao2.lotteryId > 0 && BackpackManager.Instance.OnGetGoodCount(chouJiangXiaoHao2.lotteryId) >= (long)chouJiangXiaoHao2.lotteryAmount))
        {
            this.LuckyNum10.set_text(BackpackManager.Instance.OnGetGoodCount(chouJiangXiaoHao2.lotteryId) + "/" + chouJiangXiaoHao2.lotteryAmount);
            ResourceManager.SetSprite(this.LuckyItemIcon10, GameDataUtils.GetIcon(DataReader <Items> .Get(chouJiangXiaoHao2.lotteryId).littleIcon));
        }
        else
        {
            this.LuckyNum10.set_text("x" + chouJiangXiaoHao2.amount.ToString());
            ResourceManager.SetSprite(this.LuckyItemIcon10, GameDataUtils.GetIcon(DataReader <Items> .Get(chouJiangXiaoHao2.itemId).littleIcon));
        }
    }
Esempio n. 2
0
    public void UpdateUI()
    {
        this.DrawType = LuckDrawManager.Instance.lastSelectMode;
        ChouJiangXiaoHao chouJiangXiaoHao = DataReader <ChouJiangXiaoHao> .Get(this.DrawType);

        ChouJiangXiaoHao chouJiangXiaoHao2 = DataReader <ChouJiangXiaoHao> .Get(this.DrawType + 1);

        this.Title.TextId = chouJiangXiaoHao.titleId;
        string text = string.Empty;

        if (this.DrawType == 1)
        {
            text = "1";
            this.ButtonArea1.SetActive(true);
            this.ButtonArea10.SetActive(false);
        }
        else if (this.DrawType == 3)
        {
            text = "2";
            this.ButtonArea1.SetActive(true);
            this.ButtonArea10.SetActive(true);
        }
        else if (this.DrawType == 5)
        {
            text = "3";
            this.ButtonArea1.SetActive(true);
            this.ButtonArea10.SetActive(true);
        }
        ResourceManager.SetSprite(this.ButtonDraw1.get_transform().GetComponent <Image>(), ResourceManager.GetIconSprite("cj_button_" + text));
        ResourceManager.SetSprite(this.ButtonDraw10.get_transform().GetComponent <Image>(), ResourceManager.GetIconSprite("cj_button_" + text));
        ResourceManager.SetSprite(this.Image1, ResourceManager.GetIconSprite("cj_icon_" + text));
        if (BackpackManager.Instance.OnGetGoodCount(chouJiangXiaoHao.lotteryId) >= (long)chouJiangXiaoHao.lotteryAmount || this.DrawType == 1)
        {
            this.Num1.set_text(BackpackManager.Instance.OnGetGoodCount(chouJiangXiaoHao.lotteryId) + "/" + chouJiangXiaoHao.lotteryAmount);
            ResourceManager.SetSprite(this.ItemIcon1, GameDataUtils.GetIcon(DataReader <Items> .Get(chouJiangXiaoHao.lotteryId).littleIcon));
        }
        else
        {
            this.Num1.set_text("x" + chouJiangXiaoHao.amount.ToString());
            ResourceManager.SetSprite(this.ItemIcon1, GameDataUtils.GetIcon(DataReader <Items> .Get(chouJiangXiaoHao.itemId).littleIcon));
        }
        if (this.DrawType == 1 || (chouJiangXiaoHao2.lotteryId > 0 && BackpackManager.Instance.OnGetGoodCount(chouJiangXiaoHao2.lotteryId) >= (long)chouJiangXiaoHao2.lotteryAmount))
        {
            this.Num10.set_text(BackpackManager.Instance.OnGetGoodCount(chouJiangXiaoHao2.lotteryId) + "/" + chouJiangXiaoHao2.lotteryAmount);
            ResourceManager.SetSprite(this.ItemIcon10, GameDataUtils.GetIcon(DataReader <Items> .Get(chouJiangXiaoHao2.lotteryId).littleIcon));
        }
        else
        {
            this.Num10.set_text("x" + chouJiangXiaoHao2.amount.ToString());
            ResourceManager.SetSprite(this.ItemIcon10, GameDataUtils.GetIcon(DataReader <Items> .Get(chouJiangXiaoHao2.itemId).littleIcon));
        }
        this.freeDraw = GameDataUtils.GetChineseContent(621061, false);
        this.OnSecondsPast();
    }
Esempio n. 3
0
    public bool CheckDrawType(int drawId)
    {
        bool             result           = false;
        ChouJiangXiaoHao chouJiangXiaoHao = DataReader <ChouJiangXiaoHao> .Get(drawId);

        if (chouJiangXiaoHao == null)
        {
            Debug.Log("GameData.ChouJiangXiaoHao is exist, id = " + drawId);
            return(false);
        }
        if (drawId == 1 || drawId == 2)
        {
            if (BackpackManager.Instance.OnGetGoodCount(chouJiangXiaoHao.lotteryId) >= (long)chouJiangXiaoHao.lotteryAmount)
            {
                result = true;
            }
        }
        else if (drawId == 3 || drawId == 5)
        {
            if (this.DrawIdDateTime.ContainsKey(drawId) && TimeManager.Instance.PreciseServerTime > this.DrawIdDateTime.get_Item(drawId))
            {
                result = true;
            }
            if (BackpackManager.Instance.OnGetGoodCount(chouJiangXiaoHao.lotteryId) >= (long)chouJiangXiaoHao.lotteryAmount)
            {
                result = true;
            }
            if (EntityWorld.Instance.EntSelf.Diamond >= chouJiangXiaoHao.amount)
            {
                result = true;
            }
        }
        else if (EntityWorld.Instance.EntSelf.Diamond >= chouJiangXiaoHao.amount)
        {
            result = true;
        }
        return(result);
    }
Esempio n. 4
0
    public void UpdateUI(List <AwardInfo> list)
    {
        PetManager.Instance.IsLuckDrawing = true;
        this.InfoList = list;
        this.ButtonAgain.get_gameObject().SetActive(false);
        this.ButtonConfirm.get_gameObject().SetActive(false);
        this.Consume.SetActive(false);
        using (List <int> .Enumerator enumerator = this.FxIdList.GetEnumerator())
        {
            while (enumerator.MoveNext())
            {
                int current = enumerator.get_Current();
                FXSpineManager.Instance.DeleteSpine(current, true);
            }
        }
        this.FxIdList.Clear();
        if (list.get_Count() > 1)
        {
            this.tmp = this.ItemsContent;
        }
        else
        {
            this.tmp = this.ItemsContent1;
        }
        for (int i = 0; i < this.ItemsContent.get_childCount(); i++)
        {
            Object.Destroy(this.ItemsContent.GetChild(i).get_gameObject());
        }
        for (int j = 0; j < this.ItemsContent1.get_childCount(); j++)
        {
            Object.Destroy(this.ItemsContent1.GetChild(j).get_gameObject());
        }
        this.tmp.GetComponent <GridLayoutGroup>().set_constraintCount((int)Math.Ceiling(1.0 * (double)list.get_Count() / 2.0));
        int templateId  = 1101;
        int templateId2 = 1103;

        if (this.IsClickAgain)
        {
            templateId  = 1102;
            templateId2 = 1114;
        }
        int         lastDrawType = LuckDrawManager.Instance.lastDrawType;
        IEnumerator enumerator2  = this.DofFx.GetEnumerator();

        try
        {
            while (enumerator2.MoveNext())
            {
                Transform transform = (Transform)enumerator2.get_Current();
                Object.Destroy(transform.get_gameObject());
            }
        }
        finally
        {
            IDisposable disposable = enumerator2 as IDisposable;
            if (disposable != null)
            {
                disposable.Dispose();
            }
        }
        FXManager.Instance.PlayFXOfDisplay(1000, this.DofFx, Vector3.get_zero(), default(Quaternion), 1f, 1f, 0, false, null, null);
        FXSpineManager.Instance.PlaySpine(templateId2, this.Fx, "LuckDrawResult", 3001, null, "UI", 0f, 0f, 1f, 1f, false, FXMaskLayer.MaskState.None);
        FXSpineManager.Instance.PlaySpine(templateId, this.Fx, "LuckDrawResult", 3002, null, "UI", 0f, 0f, 1f, 1f, false, FXMaskLayer.MaskState.None);
        FXSpineManager.Instance.PlaySpine(1104, this.TitleFx, "LuckDrawResult", 3001, delegate
        {
            this.FxIdList.Add(FXSpineManager.Instance.PlaySpine(1105, this.TitleFx, "LuckDrawResult", 3001, null, "UI", 0f, 0f, 1f, 1f, false, FXMaskLayer.MaskState.None));
        }, "UI", 0f, 0f, 1f, 1f, false, FXMaskLayer.MaskState.None);
        TimerHeap.AddTimer(1650u, 0, delegate
        {
            this.ShowIcon();
        });
        ChouJiangXiaoHao chouJiangXiaoHao = DataReader <ChouJiangXiaoHao> .Get(lastDrawType);

        if (chouJiangXiaoHao.lotteryId > 0 && (BackpackManager.Instance.OnGetGoodCount(chouJiangXiaoHao.lotteryId) >= (long)chouJiangXiaoHao.lotteryAmount || lastDrawType == 1 || lastDrawType == 2))
        {
            this.Num.set_text(chouJiangXiaoHao.lotteryAmount + "/" + BackpackManager.Instance.OnGetGoodCount(chouJiangXiaoHao.lotteryId));
            ResourceManager.SetSprite(this.Icon, GameDataUtils.GetIcon(DataReader <Items> .Get(chouJiangXiaoHao.lotteryId).littleIcon));
        }
        else
        {
            this.Num.set_text(chouJiangXiaoHao.amount.ToString());
            ResourceManager.SetSprite(this.Icon, GameDataUtils.GetIcon(DataReader <Items> .Get(chouJiangXiaoHao.itemId).littleIcon));
        }
    }