コード例 #1
0
        public async void startXuanZhuan(int itemId)
        {
            isDispose = false;

            for (int m = 1; m <= 5; m++)
            {
                for (int i = 0; i < ZhuanPanConfig.getInstance().getZhuanPanInfoList().Count; i++)
                {
                    if (isDispose)
                    {
                        return;
                    }

                    ZhuanPanInfo zhuanpanInfo = ZhuanPanConfig.getInstance().getZhuanPanInfoList()[i];
                    GameObject   item         = Item.transform.Find("Item_" + zhuanpanInfo.itemId).gameObject;
                    xuanzhongItem(zhuanpanInfo.itemId);

                    if ((m == 5) && (zhuanpanInfo.itemId == itemId))
                    {
                        //ToastScript.createToast("恭喜您获得" + item.transform.Find("Text_reward").GetComponent<Text>().text);
                        m_canClick = true;
                        ShowRewardUtil.Show(m_curReward);
                        return;
                    }

                    await ETModel.Game.Scene.GetComponent <TimerComponent>().WaitAsync(50);
                }
            }
        }
コード例 #2
0
        void xuanzhongItem(int itemId)
        {
            for (int i = 0; i < ZhuanPanConfig.getInstance().getZhuanPanInfoList().Count; i++)
            {
                ZhuanPanInfo zhuanpanInfo = ZhuanPanConfig.getInstance().getZhuanPanInfoList()[i];
                GameObject   item         = Item.transform.Find("Item_" + zhuanpanInfo.itemId).gameObject;

                if (zhuanpanInfo.itemId == itemId)
                {
                    item.GetComponent <Image>().sprite = CommonUtil.getSpriteByBundle("image_zhuanpan", "item_xuanzhong");
                }
                else
                {
                    item.GetComponent <Image>().sprite = CommonUtil.getSpriteByBundle("image_zhuanpan", "item_weixuanzhong");
                }
            }
        }
コード例 #3
0
        public void initData()
        {
            ReferenceCollector rc = this.GetParent <UI>().GameObject.GetComponent <ReferenceCollector>();

            Button_ChouJiang = rc.Get <GameObject>("Button_ChouJiang").GetComponent <Button>();
            Button_close     = rc.Get <GameObject>("Button_close").GetComponent <Button>();
            Button_wenhao    = rc.Get <GameObject>("Button_wenhao").GetComponent <Button>();

            Image_bg   = rc.Get <GameObject>("Image_bg");
            xingyunzhi = rc.Get <GameObject>("xingyunzhi");
            Item       = rc.Get <GameObject>("Item");

            Button_ChouJiang.onClick.Add(onClick_ChouJiang);
            Button_close.onClick.Add(onClickClose);
            Button_wenhao.onClick.Add(showGuiZe);

            Image_bg.transform.Find("Text_tip1/Btn_share").GetComponent <Button>().onClick.Add(onClickShare);

            for (int i = 0; i < ZhuanPanConfig.getInstance().getZhuanPanInfoList().Count; i++)
            {
                ZhuanPanInfo zhuanpanInfo = ZhuanPanConfig.getInstance().getZhuanPanInfoList()[i];
                GameObject   item         = Item.transform.Find("Item_" + zhuanpanInfo.itemId).gameObject;

                if (zhuanpanInfo.prop_id == 1)
                {
                    item.transform.Find("Image_icon").GetComponent <Image>().sprite = CommonUtil.getSpriteByBundle("image_zhuanpan", "icon_gold");
                    item.transform.Find("Text_reward").GetComponent <Text>().text   = ("金币" + (int)zhuanpanInfo.prop_num);
                }
                else if (zhuanpanInfo.prop_id == 3)
                {
                    item.transform.Find("Image_icon").GetComponent <Image>().sprite = CommonUtil.getSpriteByBundle("image_zhuanpan", "icon_huafei");
                    item.transform.Find("Text_reward").GetComponent <Text>().text   = ("话费" + zhuanpanInfo.prop_num + "元");
                }
            }

            if (OtherData.getIsShiedShare())
            {
                Image_bg.transform.Find("Text_tip1").localScale = Vector3.zero;
            }

            CommonUtil.SetTextFont(Button_close.transform.parent.gameObject);
            UIAnimation.ShowLayer(Button_close.transform.parent.gameObject);
        }
コード例 #4
0
        public async Task getAllData()
        {
            UINetLoadingComponent.showNetLoading();

            try
            {
                await HttpReqUtil.Req(NetConfig.getInstance().getWebUrl() + "files/tips.json", TipsConfig.getInstance().init);

                await HttpReqUtil.Req(NetConfig.getInstance().getWebUrl() + "files/prop.json", PropConfig.getInstance().init);

                await HttpReqUtil.Req(NetConfig.getInstance().getWebUrl() + "files/zhuanpan.json", ZhuanPanConfig.getInstance().init);

                await HttpReqUtil.Req(NetConfig.getInstance().getWebUrl() + "files/notice.json", NoticeConfig.getInstance().init);

                await HttpReqUtil.Req(NetConfig.getInstance().getWebUrl() + "files/friendRoomConfig.json", FriendRoomConfig.getInstance().init);

                //await SensitiveWordUtil.Req("http://fwdown.hy51v.com/online/file/stopwords.txt");

                string data = CommonUtil.getTextFileByBundle("config", "stopwords");
                SensitiveWordUtil.WordsDatas = data.Split(',');
            }
            catch (Exception ex)
            {
                Log.Error(ex);
            }

            UINetLoadingComponent.closeNetLoading();
        }