Exemple #1
0
        public void initproxy_ui()
        {
            b_load = true;
            IconHintMgr.getInsatnce().inituiisok = true;;
            IconHintMgr.getInsatnce().initui();
            //关闭第一次预加载的ui
            InterfaceMgr.getInstance().closeUiFirstTime();


            a3_activeOnlineProxy.getInstance().SendProxy(1);
            A3_signProxy.getInstance().sendproxy(1, 0);
            A3_SevenDayProxy.getInstance().SendProcy(1);
            LotteryProxy.getInstance().sendlottery((int)LotteryType.CurrentInfo);
            ExchangeProxy.getInstance().GetExchangeInfo();
            welfareProxy.getInstance().sendWelfare(welfareProxy.ActiveType.selfWelfareInfo);
            A3_AwardCenterServer.getInstance().SendMsg(A3_AwardCenterServer.SERVER_SELFDATA);  //福利数据

            //新手进主城检测摄像机
            SceneCamera.CheckLoginCam();
        }
Exemple #2
0
        void onSelfAttchange(Variant msgData)
        {
            debug.Log("属性变换" + msgData.dump());
            if (msgData.ContainsKey("mpleft"))
            {
                PlayerModel.getInstance().modMp(msgData["mpleft"]);
            }
            if (msgData.ContainsKey("hp"))
            {
                PlayerModel.getInstance().modHp(msgData["hp"]);
            }

            if (msgData.ContainsKey("vipcard_life"))
            {
                if (msgData["vipcard_life"] == 1)
                {
                    A3_signProxy.getInstance().yueka = 2;
                }
                else
                {
                    if (msgData.ContainsKey("vipcard_month_end_time"))
                    {
                        if (msgData["vipcard_month_end_time"] <= NetClient.instance.CurServerTimeStamp)
                        {
                            A3_signProxy.getInstance().yueka = 0;
                        }
                        else
                        {
                            A3_signProxy.getInstance().yueka = 1;
                        }
                    }
                }
                if (a3_Recharge.isshow)
                {
                    a3_Recharge.isshow.refre_recharge();
                }
                A3_signProxy.getInstance().sendproxy(1, 0);
            }

            if (msgData.ContainsKey("first_double"))
            {
                foreach (int info in msgData["first_double"]._arr)
                {
                    if (RechargeModel.getInstance().rechargeMenu.ContainsKey(info))
                    {
                        if (RechargeModel.getInstance().rechargeMenu[info].first_double >= 1)
                        {
                            if (!RechargeModel.getInstance().firsted.Contains(info))
                            {
                                RechargeModel.getInstance().firsted.Add(info);
                            }
                        }
                        if (a3_Recharge.isshow)
                        {
                            a3_Recharge.isshow.refre_recharge();
                        }
                    }
                }
            }

            PlayerModel.getInstance().attrChangeCheck(msgData);
            PlayerModel.getInstance().attPointCheck(msgData);
            if (msgData.ContainsKey("max_hp"))
            {
                InterfaceMgr.doCommandByLua("PlayerModel:getInstance().modHp", "model/PlayerModel", PlayerModel.getInstance().hp, msgData["max_hp"]._int);
            }
            if (msgData.ContainsKey("max_mp"))
            {
                InterfaceMgr.doCommandByLua("PlayerModel:getInstance().modMp", "model/PlayerModel", PlayerModel.getInstance().mp, msgData["max_mp"]._int);
            }
        }
Exemple #3
0
        //刷新充值种类列表
        public void recharge_Refresh()
        {
            if (retra.Count > 0)
            {
                return;
            }
            GameObject    inem = this.transform.FindChild("buy_bg/item").gameObject;
            RectTransform con  = this.transform.FindChild("buy_bg/scrollview/con").GetComponent <RectTransform>();
            Dictionary <int, rechargeData> data = new Dictionary <int, rechargeData> ();

            data = RechargeModel.getInstance().rechargeMenu;
            int num = 0;

            foreach (int i in data.Keys)
            {
                if (data[i].ka > 0)
                {
                    if (A3_signProxy.getInstance().yueka == 1)
                    {
                        if (data[i].ka == 1)
                        {
                            continue;
                        }
                    }
                    else if (A3_signProxy.getInstance().yueka == 2)
                    {
                        if (data[i].ka == 1 || data[i].ka == 2)
                        {
                            continue;
                        }
                    }
                }

                GameObject clon = (GameObject)Instantiate(inem);
                clon.SetActive(true);
                clon.transform.SetParent(con, false);
                Text name = clon.transform.FindChild("name").GetComponent <Text>();
                name.text = data[i].name;
                Text money = clon.transform.FindChild("money/Text").GetComponent <Text>();
                money.text = "¥" + data[i].golden;
                Text item_text = clon.transform.FindChild("item_text").GetComponent <Text>();

                if (data[i].first_double > 0)
                {
                    clon.transform.FindChild("double").gameObject.SetActive(true);
                }
                else
                {
                    clon.transform.FindChild("double").gameObject.SetActive(false);
                }

                if (RechargeModel.getInstance().firsted.Contains(i))
                {
                    item_text.text = StringUtils.formatText(data[i].desc2);
                    clon.transform.FindChild("double").gameObject.SetActive(false);
                }
                else
                {
                    item_text.text = StringUtils.formatText(data[i].desc);
                }

                clon.transform.FindChild("icon_di/icon_Img").GetComponent <Image>().sprite = GAMEAPI.ABUI_LoadSprite("icon_recharge_" + data[i].id.ToString());

                rechargeData dta       = data[i];
                BaseButton   btn_monet = new BaseButton(clon.transform.FindChild("money"));
                btn_monet.onClick = delegate(GameObject go) {
                    onEnsure(dta);
                };
                num++;
                retra[i] = clon;
            }
            float   childSizeX = con.GetComponent <GridLayoutGroup>().cellSize.x;
            Vector2 newSize    = new Vector2(num * childSizeX, con.sizeDelta.y);

            con.sizeDelta = newSize;
        }