예제 #1
0
 void vip_getexp_btn()
 {
     if (A3_VipModel.getInstance().Level < vip_lite(3))
     {
         btn3.transform.FindChild("image1").gameObject.SetActive(false);
         btn3.transform.FindChild("image2").gameObject.SetActive(true);
         btn3.transform.FindChild("image2/Text").GetComponent <Text>().text = "VIP" + vip_lite(3) + ContMgr.getCont("off_line_open");
     }
     else
     {
         btn3.transform.FindChild("image2").gameObject.SetActive(false);
         btn3.transform.FindChild("image1").gameObject.SetActive(true);
         btn3.transform.FindChild("image1/Text").GetComponent <Text>().text = ContMgr.getCont("off_line_lq");
     }
     if (A3_VipModel.getInstance().Level < vip_lite(4))
     {
         btn4.transform.FindChild("image1").gameObject.SetActive(false);
         btn4.transform.FindChild("image2").gameObject.SetActive(true);
         btn4.transform.FindChild("image2/Text").GetComponent <Text>().text = "VIP" + vip_lite(4) + ContMgr.getCont("off_line_open");
     }
     else
     {
         btn4.transform.FindChild("image2").gameObject.SetActive(false);
         btn4.transform.FindChild("image1").gameObject.SetActive(true);
         btn4.transform.FindChild("image1/Text").GetComponent <Text>().text = ContMgr.getCont("off_line_lq");
     }
 }
예제 #2
0
        void onExchange(GameObject go)
        {
            ExchangeModel exModel = ExchangeModel.getInstance();
            SXML          xml     = XMLMgr.instance.GetSXML("acution.exchange");

            diamand = xml.getInt("initial");
            if (PlayerModel.getInstance().gold < diamand * (exModel.Count + 1))
            {
                flytxt.instance.fly(ContMgr.getCont("a3_exchange_nozs"));
                return;
            }



            int num;

            if (A3_VipModel.getInstance().Level > 0)
            {
                num = A3_VipModel.getInstance().vip_exchange_num(3);
            }
            else
            {
                num = 10;
            }

            if ((num - exModel.Count) <= 0)
            {
                flytxt.instance.fly(ContMgr.getCont("a3_exchange_yj"));
                return;
            }

            ExchangeProxy exProxy = ExchangeProxy.getInstance();

            exProxy.Exchange();
        }
예제 #3
0
        void OnVip(Variant data)
        {
            A3_VipModel vipModel = A3_VipModel.getInstance();
            int         res      = data["res"];

            if (res == 1)
            {
                debug.Log(data.dump());
                vipModel.Level = data["viplvl"];
                vipModel.Exp   = data["vipexp"];
                vipModel.isGetVipGift.Clear();
                foreach (uint itemid in data["vip_gifts"]._arr)
                {
                    vipModel.isGetVipGift.Add(itemid);
                }
                A3_VipModel.getInstance().viplvl_refresh();
            }
            if (a3_vip.instan)
            {
                a3_vip.instan.OnGiftBtnRefresh();
            }

            if (res == 2)
            {
            }

            if (data.ContainsKey("vip_level"))
            {
                //TODO 获取VIP等级奖励
            }

            //dispatchEvent(GameEvent.Create(EVENT_ON_VIP_CHANGE, this, data));
        }
        public void RefreshTxt()
        {
            int num = A3_VipModel.getInstance().vip_exchange_num(22);

            today_build_count.text = ContMgr.getCont("a3_legion_build0") + (num - A3_LegionModel.getInstance().build_count).ToString() + "/" + num;
            personal_give.text     = ContMgr.getCont("a3_legion_build1") + A3_LegionModel.getInstance().build_my_get.ToString();
            today_build_money.text = A3_LegionModel.getInstance().build_clan_get.ToString();
        }
예제 #5
0
        public override void init()
        {
            a3_vip.instan = this;
            bool flag = this.uiData != null;

            if (flag)
            {
                int type = (int)this.uiData[0];
                this.setopen(type);
            }
            this.tip                 = base.transform.FindChild("tip").gameObject;
            this.btnClose            = new BaseButton(base.getTransformByPath("btn_close"), 1, 1);
            this.btnClose.onClick    = new Action <GameObject>(this.OnCLoseClick);
            this.isManLvl            = base.transform.FindChild("topCon/isMaxLvl").gameObject;
            this.imageCurLevel       = base.getComponentByPath <Image>("topCon/Image_level");
            this.ExpImg              = base.getComponentByPath <Image>("topCon/Image_exp");
            this.textBuyNum          = base.getComponentByPath <Text>("topCon/Text_bg_1/Text_num");
            this.textNextLevel       = base.getComponentByPath <Text>("topCon/Text_level");
            this.btnRecharge         = new BaseButton(base.getTransformByPath("btn_recharge"), 1, 1);
            this.btnRecharge.onClick = new Action <GameObject>(this.OnRechargeBtnClick);
            this.vipGiftBtn          = new BaseButton(base.getTransformByPath("bottomCon/top_btn/btn_1"), 1, 1);
            this.vipGiftBtn.onClick  = new Action <GameObject>(this.OpenVipGift);
            this.vipPriBtn           = new BaseButton(base.getTransformByPath("bottomCon/top_btn/btn_2"), 1, 1);
            this.vipPriBtn.onClick   = new Action <GameObject>(this.OpenVipPri);
            this.tab1                = base.getGameObjectByPath("bottomCon/tab_1");
            this.tab2                = base.getGameObjectByPath("bottomCon/tab_2");
            this.conBtnTable         = base.getTransformByPath("bottomCon/tab_1/con_btn");
            this.viplnl_view         = this.conBtnTable.FindChild("scrollview/con");
            this.conGiftTable        = base.getTransformByPath("bottomCon/tab_1/con_gift");
            this.conPermissionTable  = base.getTransformByPath("bottomCon/tab_1/con_permission");
            this.btnGetGift          = new BaseButton(base.getTransformByPath("bottomCon/tab_1/con_gift/btn_get"), 1, 1);
            this.giftlvl             = base.getTransformByPath("bottomCon/tab_1/con_gift/Text_level");
            this.lvl                 = this.giftlvl.GetComponent <Text>();
            this.btnGetGift.onClick  = new Action <GameObject>(this.OnGetBtnClick);
            this.up_btn              = new BaseButton(base.getTransformByPath("bottomCon/tab_1/con_btn/up_btn"), 1, 1);
            this.dow_btn             = new BaseButton(base.getTransformByPath("bottomCon/tab_1/con_btn/dow_btn"), 1, 1);
            this.up_btn.onClick      = new Action <GameObject>(this.onUp_btn);
            this.dow_btn.onClick     = new Action <GameObject>(this.onDow_btn);
            this.con                 = this.conPermissionTable.FindChild("view/con").GetComponent <RectTransform>();
            this.conBtn              = this.conBtnTable.FindChild("scrollview/con");
            this.gftCon              = this.conGiftTable.FindChild("view/con").GetComponent <RectTransform>();
            base.transform.FindChild("Image_left").GetComponent <CanvasGroup>().blocksRaycasts  = false;
            base.transform.FindChild("Image_right").GetComponent <CanvasGroup>().blocksRaycasts = false;
            this.conState = base.getTransformByPath("bottomCon/tab_2");
            this.vipModel = ModelBase <A3_VipModel> .getInstance();

            this.vipXml = this.vipModel.VipLevelXML;
            this.v      = this.con.position;
            this.v1     = this.conBtn.position;
            this.v2     = this.gftCon.position;
            this.InitBtnList();
            this.InitVip_priList();
            this.vipGiftBtn.interactable = false;
            base.init();
        }
예제 #6
0
 private void OnEqp(GameObject go)
 {
     if (A3_VipModel.getInstance().Level >= 3)
     {
         InterfaceMgr.getInstance().ui_async_open(InterfaceMgr.A3_AUTOPLAY_EQP);
     }
     else
     {
         flytxt.instance.fly(ContMgr.getCont("a3_autoplay2_vip"));
     }
 }
        public a3_sportsModel() : base()
        {
            SXML Xml = XMLMgr.instance.GetSXML("jjc.info");

            if (Xml == null)
            {
                return;
            }

            buy_cnt = A3_VipModel.getInstance().vip_exchange_num(7);

            callenge_cnt = Xml.getInt("callenge_cnt");

            buy_zuan_count = Xml.getInt("buy_cost");
        }
예제 #8
0
        //经验值变化
        private void OnExpChange()
        {
            int maxExp  = A3_VipModel.getInstance().GetNextLvlMaxExp();
            int leftExp = maxExp - A3_VipModel.getInstance().Exp;

            NeedCount.text = leftExp.ToString();
            if (maxExp > 0)
            {
                ExpImg.fillAmount = (float)A3_VipModel.getInstance().Exp / maxExp;
            }
            else
            {
                ExpImg.fillAmount = 1;
            }
        }
예제 #9
0
        public override void onClosed()
        {
            GRMap.GAME_CAMERA.SetActive(true);
            UIClient.instance.removeEventListener(9005u, new Action <GameEvent>(this.Refresh_Diamond));
            A3_VipModel expr_2E = ModelBase <A3_VipModel> .getInstance();

            expr_2E.OnExpChange = (Action)Delegate.Remove(expr_2E.OnExpChange, new Action(this.OnExpChange));
            A3_VipModel expr_54 = ModelBase <A3_VipModel> .getInstance();

            expr_54.OnLevelChange = (Action)Delegate.Remove(expr_54.OnLevelChange, new Action(this.OnVipLevelChange));
            bool flag = a3_relive.instans;

            if (flag)
            {
                a3_relive.instans.FX.SetActive(true);
            }
        }
예제 #10
0
 public override void onShowed()
 {
     isshow = this;
     GRMap.GAME_CAMERA.SetActive(false);
     UIClient.instance.addEventListener(UI_EVENT.ON_MONEY_CHANGE, Refresh_Diamond);
     A3_VipModel.getInstance().OnExpChange   += OnExpChange;
     A3_VipModel.getInstance().OnLevelChange += OnVipLevelChange;
     OnVipLevelChange();
     OnExpChange();
     recharge_Refresh();
     Refresh_Diamond(null);
     toTach_close = false;
     if (a3_relive.instans)
     {
         transform.SetAsLastSibling();
         a3_relive.instans.FX.SetActive(false);
     }
 }
예제 #11
0
        public override void onClosed()
        {
            A3_VipModel expr_07 = this.vipModel;

            expr_07.OnLevelChange = (Action)Delegate.Remove(expr_07.OnLevelChange, new Action(this.OnVipLevelChange));
            A3_VipModel expr_2E = this.vipModel;

            expr_2E.OnExpChange = (Action)Delegate.Remove(expr_2E.OnExpChange, new Action(this.OnExpChange));
            GRMap.GAME_CAMERA.SetActive(true);
            InterfaceMgr.getInstance().changeState(InterfaceMgr.STATE_NORMAL);
            bool flag = a3_relive.instans;

            if (flag)
            {
                a3_relive.instans.FX.SetActive(true);
            }
            base.onClosed();
            InterfaceMgr.getInstance().itemToWin(this.Toclose, this.uiName);
        }
예제 #12
0
        //等级变化
        private void OnVipLevelChange()
        {//
            int level = A3_VipModel.getInstance().Level;

            Vip_lvl.text = level.ToString();

            if (level >= A3_VipModel.getInstance().GetMaxVipLevel())
            {
                ToNextVip.gameObject.SetActive(false);
                toptext.SetActive(false);
                isManLvl.SetActive(true);
            }
            else
            {
                ToNextVip.text = "VIP" + (level + 1);
                ToNextVip.gameObject.SetActive(true);
                toptext.SetActive(true);
                isManLvl.SetActive(false);
            }
        }
예제 #13
0
        public void AutoEquipProcess(a3_BagItemData itmdata)
        {
            AutoPlayModel apmodel = AutoPlayModel.getInstance();

            //!--非自动挂机不做处理
            if (!SelfRole.fsm.Autofighting)
            {
                return;
            }

            //!--不处理装备,或vip等级3以下
            if (apmodel.EqpType == 0 || A3_VipModel.getInstance().Level < 3)
            {
                return;
            }

            int eqpproc = apmodel.EqpProc;
            int quality = itmdata.confdata.quality;
            int bitqual = (1 << (quality - 1));

            if ((eqpproc & bitqual) == 0)
            {
                return;
            }

            if (apmodel.EqpType == 1)
            {//!--自动出售
                BagProxy.getInstance().sendSellItems(itmdata.id, itmdata.num);


                flytxt.instance.fly(ContMgr.getCont("StatePick0") + Globle.getColorStrByQuality(itmdata.confdata.item_name, itmdata.confdata.quality));
            }
            else if (apmodel.EqpType == 2)
            {//!--自动分解
                List <uint> eqps = new List <uint>();
                eqps.Add(itmdata.id);
                EquipProxy.getInstance().sendsell(eqps);

                flytxt.instance.fly(ContMgr.getCont("StatePick1") + Globle.getColorStrByQuality(itmdata.confdata.item_name, itmdata.confdata.quality));
            }
        }
예제 #14
0
        public override void onShowed()
        {
            GRMap.GAME_CAMERA.SetActive(false);
            UIClient.instance.addEventListener(9005u, new Action <GameEvent>(this.Refresh_Diamond));
            A3_VipModel expr_2E = ModelBase <A3_VipModel> .getInstance();

            expr_2E.OnExpChange = (Action)Delegate.Combine(expr_2E.OnExpChange, new Action(this.OnExpChange));
            A3_VipModel expr_54 = ModelBase <A3_VipModel> .getInstance();

            expr_54.OnLevelChange = (Action)Delegate.Combine(expr_54.OnLevelChange, new Action(this.OnVipLevelChange));
            this.OnVipLevelChange();
            this.OnExpChange();
            this.Refresh_Diamond(null);
            bool flag = a3_relive.instans;

            if (flag)
            {
                base.transform.SetAsLastSibling();
                a3_relive.instans.FX.SetActive(false);
            }
        }
예제 #15
0
        private void OnVip(Variant data)
        {
            A3_VipModel instance = ModelBase <A3_VipModel> .getInstance();

            int  num  = data["res"];
            bool flag = num == 1;

            if (flag)
            {
                debug.Log(data.dump());
                instance.Level = data["viplvl"];
                instance.Exp   = data["vipexp"];
                instance.isGetVipGift.Clear();
                using (List <Variant> .Enumerator enumerator = data["vip_gifts"]._arr.GetEnumerator())
                {
                    while (enumerator.MoveNext())
                    {
                        uint item = enumerator.Current;
                        instance.isGetVipGift.Add(item);
                    }
                }
                ModelBase <A3_VipModel> .getInstance().viplvl_refresh();
            }
            bool flag2 = a3_vip.instan;

            if (flag2)
            {
                a3_vip.instan.OnGiftBtnRefresh();
            }
            bool flag3 = num == 2;

            if (flag3)
            {
            }
            bool flag4 = data.ContainsKey("vip_level");

            if (flag4)
            {
            }
        }
예제 #16
0
        public A3_ActiveModel() : base()
        {
            //int num;
            // if (A3_VipModel.getInstance().Level > 0)
            //    num = A3_VipModel.getInstance().vip_exchange_num(7);
            //else
            //    num = 10;

            SXML Xml = XMLMgr.instance.GetSXML("jjc.info");

            if (Xml == null)
            {
                return;
            }

            buy_cnt = A3_VipModel.getInstance().vip_exchange_num(7);

            callenge_cnt = Xml.getInt("callenge_cnt");

            buy_zuan_count = Xml.getInt("buy_cost");
            listKilled     = new List <int>();
        }
예제 #17
0
        void refreshCount()
        {
            int num;

            if (A3_VipModel.getInstance().Level > 0)
            {
                num = A3_VipModel.getInstance().vip_exchange_num(3);
            }
            else
            {
                num = 10;
            }
            ExchangeModel exModel = ExchangeModel.getInstance();
            SXML          xml     = XMLMgr.instance.GetSXML("acution.exchange");

            diamand = xml.getInt("initial");
            getComponentByPath <Text>("diamand/Text").text = (diamand * (exModel.Count + 1)).ToString();
            if (num - exModel.Count >= 0)
            {
                getComponentByPath <Text>("exchangeBtn/Text/leftCnt").text = "(" + (num - exModel.Count) + "/" + num + ")";
            }
        }
예제 #18
0
        public override void onShowed()
        {
            this.Toclose = false;
            this.OnVipTabHanle(1);
            A3_VipModel expr_16 = this.vipModel;

            expr_16.OnLevelChange = (Action)Delegate.Combine(expr_16.OnLevelChange, new Action(this.OnVipLevelChange));
            A3_VipModel expr_3D = this.vipModel;

            expr_3D.OnExpChange = (Action)Delegate.Combine(expr_3D.OnExpChange, new Action(this.OnExpChange));
            BaseProxy <A3_VipProxy> .getInstance().GetVip();

            this.OnVipLevelChange();
            this.OnExpChange();
            this.OnGiftBtnRefresh();
            bool flag = this.VipBtnList[0] != null;

            if (flag)
            {
                this.BtnList();
                this.VipBtnList[0].GetComponent <Button>().interactable = false;
            }
            this.con.position    = this.v;
            this.conBtn.position = this.v1;
            this.gftCon.position = this.v2;
            this.lvl.text        = "1";
            this.nowlook_viplvl  = 1;
            InterfaceMgr.getInstance().changeState(InterfaceMgr.STATE_FUNCTIONBAR);
            base.onShowed();
            this.tip.SetActive(false);
            GRMap.GAME_CAMERA.SetActive(false);
            bool flag2 = a3_relive.instans;

            if (flag2)
            {
                base.transform.SetAsLastSibling();
                a3_relive.instans.FX.SetActive(false);
            }
        }
예제 #19
0
        public override void onClosed()
        {
            isshow = null;
            GRMap.GAME_CAMERA.SetActive(true);
            UIClient.instance.removeEventListener(UI_EVENT.ON_MONEY_CHANGE, Refresh_Diamond);
            A3_VipModel.getInstance().OnExpChange   -= OnExpChange;
            A3_VipModel.getInstance().OnLevelChange -= OnVipLevelChange;
            foreach (GameObject o in retra.Values)
            {
                Destroy(o);
            }
            retra.Clear();

            //Instance = null;
            if (a3_relive.instans)
            {
                a3_relive.instans.FX.SetActive(true);
            }
            if (a3_lottery.mInstance?.toRecharge == true && toTach_close)
            {
                a3_lottery.mInstance.toRecharge = false;
                InterfaceMgr.getInstance().ui_async_open(InterfaceMgr.A3_LOTTERY);
            }

            if (a3_sign.instan != null && a3_sign.instan.returnthis && toTach_close)
            {
                a3_sign.instan.returnthis = false;
                InterfaceMgr.getInstance().ui_async_open(InterfaceMgr.A3_SIGN);
            }

            if (a3_new_pet.instance != null && a3_new_pet.instance.toback && toTach_close)
            {
                a3_new_pet.instance.toback = false;
                InterfaceMgr.getInstance().ui_async_open(InterfaceMgr.A3_NEW_PET);
            }
        }
예제 #20
0
        void refresh()
        {
            var dd = A3_TaskModel.getInstance().GetDailyTask();

            if (dd != null)
            {
                cs_rotine.text = "(" + (A3_TaskModel.getInstance().GetTaskMaxCount(dd.taskId) - dd.taskCount) + "/" + A3_TaskModel.getInstance().GetTaskMaxCount(dd.taskId) + ")";
                this.transform.FindChild("cells/scroll/content/routine").gameObject.SetActive(true);
            }
            else
            {
                //cs_rotine.text = "(未开启)";
                this.transform.FindChild("cells/scroll/content/routine").gameObject.SetActive(false);
            }
            Variant data      = SvrLevelConfig.instacne.get_level_data(102);
            int     max_times = data["daily_cnt"];
            int     use_times = 0;

            if (MapModel.getInstance().dFbDta.ContainsKey(102))
            {
                use_times = Mathf.Min(MapModel.getInstance().dFbDta[102].cycleCount, max_times);
            }
            if (FunctionOpenMgr.instance.Check(FunctionOpenMgr.GOLD_DUNGEON) && max_times != use_times)
            {
                cs_goldfb.text = "(" + (max_times - use_times) + "/" + max_times + ")";
                this.transform.FindChild("cells/scroll/content/goldfb").gameObject.SetActive(true);
            }
            else
            {
                //cs_expfb.text = "(未开启)";
                this.transform.FindChild("cells/scroll/content/goldfb").gameObject.SetActive(false);
            }

            //if (ExchangeModel.getInstance().Count >= 10)
            //{

            //}
            //else
            //{
            //    cs_getMoney.text = "(" + (10 - ExchangeModel.getInstance().Count) + "/10)";
            //    this.transform.FindChild("cells/scroll/content/dianjin").gameObject.SetActive(true);
            //}
            int num;

            if (A3_VipModel.getInstance().Level > 0)
            {
                num = A3_VipModel.getInstance().vip_exchange_num(3);
            }
            else
            {
                num = 10;
            }
            ExchangeModel exModel = ExchangeModel.getInstance();

            if (num - exModel.Count > 0)
            {
                cs_getMoney.text = "(" + (num - exModel.Count) + "/" + num + ")";
                this.transform.FindChild("cells/scroll/content/dianjin").gameObject.SetActive(true);
            }
            else
            {
                this.transform.FindChild("cells/scroll/content/dianjin").gameObject.SetActive(false);
            }
        }
예제 #21
0
        public override void init()
        {
            instan          = this;
            scrollControer0 = new ScrollControler();
            scrollControer0.create(getComponentByPath <ScrollRect>("bottomCon/tab_2/scrollview"));
            if (uiData != null)
            {
                int type = (int)uiData[0];
                setopen(type);
            }

            tip              = this.transform.FindChild("tip").gameObject;
            btnClose         = new BaseButton(this.getTransformByPath("btn_close"));
            btnClose.onClick = OnCLoseClick;

            v_con         = this.transform.FindChild("bottomCon/tab_1/con_btn/scrollview/con");
            up            = this.transform.FindChild("bottomCon/tab_1/con_btn/Image_shang").gameObject;
            down          = this.transform.FindChild("bottomCon/tab_1/con_btn/Image_xia").gameObject;
            isManLvl      = this.transform.FindChild("topCon/isMaxLvl").gameObject;
            imageCurLevel = this.getComponentByPath <Image>("topCon/Image_level");
            //sliderExp = this.getComponentByPath<Slider>("topCon/expSlider");
            ExpImg              = this.getComponentByPath <Image>("topCon/Image_exp");
            textBuyNum          = this.getComponentByPath <Text>("topCon/Text_bg_1/Text_num");
            textNextLevel       = this.getComponentByPath <Text>("topCon/Text_level");
            btnRecharge         = new BaseButton(this.getTransformByPath("btn_recharge"));
            btnRecharge.onClick = OnRechargeBtnClick;
            vipGiftBtn          = new BaseButton(this.getTransformByPath("bottomCon/top_btn/btn_1"));
            vipGiftBtn.onClick  = OpenVipGift;
            vipPriBtn           = new BaseButton(this.getTransformByPath("bottomCon/top_btn/btn_2"));
            vipPriBtn.onClick   = OpenVipPri;

            //tab
            tab1 = this.getGameObjectByPath("bottomCon/tab_1");
            tab2 = this.getGameObjectByPath("bottomCon/tab_2");
            //tab_1
            conBtnTable        = this.getTransformByPath("bottomCon/tab_1/con_btn");
            viplnl_view        = conBtnTable.FindChild("scrollview/con");
            conGiftTable       = this.getTransformByPath("bottomCon/tab_1/con_gift");
            conPermissionTable = this.getTransformByPath("bottomCon/tab_1/con_permission");
            btnGetGift         = new BaseButton(this.getTransformByPath("bottomCon/tab_1/con_gift/btn_get"));
            giftlvl            = this.getTransformByPath("bottomCon/tab_1/con_gift/Text_level");
            lvl = giftlvl.GetComponent <Text>();
            btnGetGift.onClick = OnGetBtnClick;
            this.transform.FindChild("bottomCon/tab_1/con_btn/scrollview").GetComponent <ScrollRect>().onValueChanged.AddListener((any) => CheckArrow());
            con    = conPermissionTable.FindChild("view/con").GetComponent <RectTransform>();
            conBtn = conBtnTable.FindChild("scrollview/con");
            gftCon = conGiftTable.FindChild("view/con").GetComponent <RectTransform>();

            this.transform.FindChild("Image_left").GetComponent <CanvasGroup>().blocksRaycasts  = false;
            this.transform.FindChild("Image_right").GetComponent <CanvasGroup>().blocksRaycasts = false;

            //tab_2
            conState = this.getTransformByPath("bottomCon/tab_2");
            //textVipState = this.getComponentByPath<Text>("bottomCon/tab_2/scrollview/con");

            vipModel = A3_VipModel.getInstance();
            vipXml   = vipModel.VipLevelXML;

            v  = con.position;
            v1 = conBtn.position;
            v2 = gftCon.position;
            InitBtnList();
            InitVip_priList();
            //textVipState.text = vipModel.GetVipState();
            vipGiftBtn.interactable = false;
            base.init();


            getComponentByPath <Text>("bottomCon/tab_1/con_gift/btn_get/text").text             = ContMgr.getCont("a3_vip_0");
            getComponentByPath <Text>("bottomCon/tab_1/con_gift/Text_level/Text").text          = ContMgr.getCont("a3_vip_1");
            getComponentByPath <Text>("bottomCon/tab_1/con_gift/ImageTemp/pri_text").text       = ContMgr.getCont("a3_vip_2");
            getComponentByPath <Text>("bottomCon/tab_1/con_permission/ImageTemp/pri_text").text = ContMgr.getCont("a3_vip_2");
            getComponentByPath <Text>("bottomCon/tab_1/con_permission/Text").text              = ContMgr.getCont("a3_vip_3");
            getComponentByPath <Text>("bottomCon/tab_2/top_text/per_tip/Text").text            = ContMgr.getCont("a3_vip_4");
            getComponentByPath <Text>("bottomCon/tab_2/scrollview/con/item/per_tip/Text").text = ContMgr.getCont("a3_vip_4");
            getComponentByPath <Text>("bottomCon/top_btn/btn_1/Text").text = ContMgr.getCont("a3_vip_5");
            getComponentByPath <Text>("bottomCon/top_btn/btn_2/Text").text = ContMgr.getCont("a3_vip_6");
            getComponentByPath <Text>("topCon/isMaxLvl").text   = ContMgr.getCont("a3_vip_7");
            getComponentByPath <Text>("btn_recharge/text").text = ContMgr.getCont("a3_vip_8");
            getComponentByPath <Text>("topCon/Text_bg_1").text  = ContMgr.getCont("Text_bg_1");


            getComponentByPath <Text>("tip/text_bg/name/lite").text = ContMgr.getCont("a3_vip_9");
            getComponentByPath <Text>("tip/text_bg/name/has").text  = ContMgr.getCont("a3_vip_10");
        }
예제 #22
0
        private void on_sprite_invisible(Variant msgData)
        {
            debug.Log("on_sprite_invisible::" + msgData.dump());

            uint iid = msgData["iid"]._uint;
            //uint m_unCID = 0;
            bool invisible = msgData["invisible"] > 0;

            if (iid == SelfRole._inst.m_unIID)
            {
                SelfRole._inst.invisible = invisible;
                if (a1_gamejoy.inst_skillbar != null)
                {
                    a1_gamejoy.inst_skillbar.forSkill_5008(invisible);
                }

                isyinsh = invisible;
                SelfRole._inst.refreshmapCount((int)PlayerModel.getInstance().treasure_num);
                SelfRole._inst.refreshVipLvl((uint)A3_VipModel.getInstance().Level);
                //m_unCID  = PlayerModel.getInstance().cid;

                if (A3_SummonModel.getInstance().nowShowAttackID != 0 && invisible)
                {
                    A3_SummonProxy.getInstance().sendZhaohui();
                }
                else if (A3_SummonModel.getInstance().nowShowAttackID != 0 && A3_SummonModel.getInstance().lastSummonID != 0 && invisible == false)
                {
                    if (A3_SummonModel.getInstance().getSumCds().ContainsKey(( int )A3_SummonModel.getInstance().lastSummonID))
                    {
                        flytxt.instance.fly(ContMgr.getCont("a3_summon10"));
                    }
                    else
                    {
                        A3_SummonProxy.getInstance().sendChuzhan(A3_SummonModel.getInstance().lastSummonID);
                    }
                } //隐身状态下 把召唤兽 收回
            }
            else
            {
                ProfessionRole pr = OtherPlayerMgr._inst.GetOtherPlayer(iid);

                if (pr != null)
                {
                    pr.invisible = invisible;

                    if (invisible && SelfRole._inst.m_LockRole == pr)
                    {
                        SelfRole._inst.m_LockRole = null;
                    }

                    if (pr.invisible == false && pr.dianjiTime == -1 && pr.isUp == false)
                    {
                        pr.ChangeRideState(true);
                    }
                }

                //m_unCID  = pr.m_unCID;
            }

            //uint monsterIID = 0;

            //if ( MonsterMgr._inst.roleSummonMapping.ContainsKey( m_unCID ) )
            //{
            //     monsterIID =  MonsterMgr._inst.roleSummonMapping[ m_unCID ]; // 召唤兽iid
            //}


            //if ( monsterIID != null && MonsterMgr._inst.m_mapMonster.ContainsKey( monsterIID ) )
            //{
            //    var monster =  MonsterMgr._inst.m_mapMonster[ monsterIID ];

            //    if ( monster is MS0000 )
            //    {
            //        ( monster as MS0000 ).invisibleState = invisible ;
            //    }

            //}
        }
예제 #23
0
        void refresh()
        {
            var dd = A3_TaskModel.getInstance().GetDailyTask();

            if (dd != null)
            {
                cs_rotine.text = "(" + (A3_TaskModel.getInstance().GetTaskMaxCount(dd.taskId) - dd.taskCount) + "/" + A3_TaskModel.getInstance().GetTaskMaxCount(dd.taskId) + ")";
                this.transform.FindChild("cells/scroll/content/routine").gameObject.SetActive(true);
            }
            else
            {
                //cs_rotine.text = "(未开启)";
                this.transform.FindChild("cells/scroll/content/routine").gameObject.SetActive(false);
            }

            Variant data      = SvrLevelConfig.instacne.get_level_data(101);
            int     max_times = data["daily_cnt"] + A3_VipModel.getInstance().expFb_count;
            int     use_times = 0;

            if (MapModel.getInstance().dFbDta.ContainsKey(101))
            {
                use_times = Mathf.Min(MapModel.getInstance().dFbDta[101].cycleCount, max_times);
            }
            if (FunctionOpenMgr.instance.Check(FunctionOpenMgr.EXP_DUNGEON))
            {
                cs_expfb.text = "(" + (max_times - use_times) + "/" + max_times + ")";
                this.transform.FindChild("cells/scroll/content/expfb").gameObject.SetActive(true);
            }
            else
            {
                //cs_expfb.text = "(未开启)";
                this.transform.FindChild("cells/scroll/content/expfb").gameObject.SetActive(false);
            }

            if (FunctionOpenMgr.instance.Check(FunctionOpenMgr.ENTRUST_TASK))
            {
                TaskData entrustTask;
                if ((entrustTask = A3_TaskModel.getInstance().GetEntrustTask()) != null)
                {
                    int curCount, maxCount;
                    maxCount = XMLMgr.instance.GetSXML("task.emis_limit").getInt("emis_limit") * XMLMgr.instance.GetSXML("task.emis_limit").getInt("loop_limit");
                    curCount = maxCount - (entrustTask.taskCount + entrustTask.taskLoop * XMLMgr.instance.GetSXML("task.emis_limit").getInt("emis_limit"));
                    curCount = curCount > 0 ? curCount : 0;
                    this.transform.FindChild("cells/scroll/content/entrustTask").gameObject.SetActive(true);
                    this.transform.FindChild("cells/scroll/content/entrustTask/name/dj").GetComponent <Text>().text =
                        string.Format("{0}/{1}", curCount, maxCount);
                }
                else
                {
                    this.transform.FindChild("cells/scroll/content/entrustTask").gameObject.SetActive(false);
                }
            }
            else
            {
                this.transform.FindChild("cells/scroll/content/entrustTask").gameObject.SetActive(false);
            }

            if (FunctionOpenMgr.instance.Check(FunctionOpenMgr.AUTO_PLAY))
            {
                if (GeneralProxy.getInstance().active_open)
                {
                    getTransformByPath("cells/scroll/content/sczghd/go").GetComponent <Button>().interactable = true;
                    this.transform.FindChild("cells/scroll/content/sczghd").gameObject.SetActive(true);
                    this.transform.FindChild("cells/scroll/content/guaji").gameObject.SetActive(false);
                    //getTransformByPath("cells/scroll/content/sczghd/go/text").GetComponent<Text>().text = "(已经开启)";
                }
                else
                {
                    this.transform.FindChild("cells/scroll/content/sczghd").gameObject.SetActive(false);
                    this.transform.FindChild("cells/scroll/content/guaji").gameObject.SetActive(true);
                    //getTransformByPath("cells/scroll/content/sczghd/go").GetComponent<Button>().interactable = false;
                    //getTransformByPath("cells/scroll/content/sczghd/go/text").GetComponent<Text>().text = "(等待开启)";
                }
            }
            else
            {
                getTransformByPath("cells/scroll/content/sczghd/go").GetComponent <Button>().interactable = false;
                this.transform.FindChild("cells/scroll/content/sczghd").gameObject.SetActive(false);
                this.transform.FindChild("cells/scroll/content/guaji").gameObject.SetActive(false);
            }
            cs_sczghd.text = "";
            want_to();
        }
        public void show(INameObj avatar)
        {
            if (dItem.ContainsKey(avatar))
            {
                return;
            }

            PlayerNameItem item;

            if (lPool.Count == 0)
            {
                GameObject temp = GAMEAPI.ABLayer_LoadNow_GameObject("uilayer_name_user");
                GameObject go   = GameObject.Instantiate(temp) as GameObject;
                go.transform.SetParent(playerNameLayer, false);
                item = new PlayerNameItem(go.transform);
            }
            else
            {
                item          = lPool[0];
                item.visiable = true;
                lPool.RemoveAt(0);
            }


            if (avatar is ProfessionRole)
            {
                if (!(avatar as ProfessionRole).m_isMain)
                {
                    allOtherTitle[(avatar as ProfessionRole).m_unCID] = item.heroTitleIcon.gameObject;
                }
                else
                {
                    selfTitleGo = item.heroTitleIcon.gameObject;
                }
            }

            item.refresh(avatar);
            lItem.Add(item);
            dItem[avatar] = item;

            if (avatar is MonsterRole)
            {
                if (A3_ActiveModel.getInstance() != null)
                {
                    if (A3_ActiveModel.getInstance().mwlr_target_monId == 0 || (avatar as MonsterRole).monsterid != A3_ActiveModel.getInstance().mwlr_target_monId)
                    {
                        item.mhPlayerName.transform.parent.gameObject.SetActive(false);
                    }
                    else
                    {
                        item.mhPlayerName.transform.parent.gameObject.SetActive(true);
                    }
                }
                else
                {
                    item.mhPlayerName.transform.parent.gameObject.SetActive(false);
                }
            }
            else
            {
                item.mhPlayerName.transform.parent.gameObject.SetActive(false);
            }
            if (avatar is MDC000)
            {
                carObj = avatar;
                item.setHP((( float )(avatar.curhp / avatar.maxHp) * 100).ToString());
                carItem = item;
                item.refreshHp(avatar.curhp, avatar.maxHp, avatar);
            }
            else
            {
                item.cartxt.gameObject.SetActive(false);
                item.refreshHp(avatar.curhp, avatar.maxHp);
            }

            //if (avatar is self)
            //item.refreshVipLv(avatar.lgAvatar.viewInfo["vip"]);
            //else
            item.refreicon();
            item.refreshVipLv(0);
            if (avatar is ProfessionRole)
            {
                if ((avatar as ProfessionRole).m_isMain)
                {
                    if (PlayerModel.getInstance().istitleActive)
                    {
                        item.refreshTitle(a3_RankModel.now_id);
                    }
                    item.refresNameColor(( int )PlayerModel.getInstance().now_nameState);

                    if (PlayerModel.getInstance().inSpost&& PlayerModel.getInstance().lvlsideid != 0)
                    {
                        if (PlayerModel.getInstance().lvlsideid == 1)
                        {
                            item.refresNameColor_spost(SPOSTNAME_TYPE.RED);
                        }
                        else if (PlayerModel.getInstance().lvlsideid == 2)
                        {
                            item.refresNameColor_spost(SPOSTNAME_TYPE.BULE);
                        }
                    }
                    else if (PlayerModel.getInstance().inCityWar&& PlayerModel.getInstance().lvlsideid != 0)
                    {
                        item.refresNameColor_spost(SPOSTNAME_TYPE.BULE);
                    }

                    item.refresHitback(( int )PlayerModel.getInstance().hitBack);
                    item.refreshVipLv(( uint )A3_VipModel.getInstance().Level);
                }
                else
                {
                    item.refreshTitle(avatar.title_id);
                    item.refresNameColor(avatar.rednm);

                    if (PlayerModel.getInstance().inSpost&& avatar.spost_lvlsideid != 0)
                    {
                        if (1 == avatar.spost_lvlsideid)
                        {
                            item.refresNameColor_spost(SPOSTNAME_TYPE.RED);
                        }
                        else if (2 == avatar.spost_lvlsideid)
                        {
                            item.refresNameColor_spost(SPOSTNAME_TYPE.BULE);
                        }
                    }

                    else if (PlayerModel.getInstance().inCityWar&& avatar.spost_lvlsideid != 0)
                    {
                        if (avatar.spost_lvlsideid == PlayerModel.getInstance().lvlsideid)
                        {
                            item.refresNameColor_spost(SPOSTNAME_TYPE.BULE);
                        }
                        else
                        {
                            item.refresNameColor_spost(SPOSTNAME_TYPE.RED);
                        }
                    }
                    item.refresHitback(( int )avatar.hidbacktime);
                }
            }
            else
            {
                item.refreshTitle(avatar.title_id);
            }
        }
예제 #25
0
        private void OnClickToGetExp(int type)
        {
            A3_VipModel a3_VipModel = ModelBase <A3_VipModel> .getInstance();

            bool flag = !this.offLineModel.CanGetExp;

            if (flag)
            {
                flytxt.instance.fly(ContMgr.getCont("off_line_empty", null), 0, default(Color), null);
                InterfaceMgr.getInstance().close(InterfaceMgr.OFFLINEEXP);
                a3_expbar.instance.getGameObjectByPath("operator/LightTips/btnAuto_off_line_exp").SetActive(false);
            }
            else
            {
                this.offline_item.Clear();
                this.offline = true;
                switch (type)
                {
                case 1:
                {
                    bool isOn = this.fenjie.isOn;
                    if (isOn)
                    {
                        BaseProxy <OffLineExpProxy> .getInstance().sendType(1, true);
                    }
                    else
                    {
                        BaseProxy <OffLineExpProxy> .getInstance().sendType(1, false);
                    }
                    this.currentType = 1;
                    break;
                }

                case 2:
                {
                    bool flag2 = ModelBase <PlayerModel> .getInstance().money < ModelBase <OffLineModel> .getInstance().GetCost(2);

                    if (flag2)
                    {
                        flytxt.instance.fly(ContMgr.getCont("off_line_exp_money", null), 0, default(Color), null);
                    }
                    else
                    {
                        bool isOn2 = this.fenjie.isOn;
                        if (isOn2)
                        {
                            BaseProxy <OffLineExpProxy> .getInstance().sendType(2, true);
                        }
                        else
                        {
                            BaseProxy <OffLineExpProxy> .getInstance().sendType(2, false);
                        }
                    }
                    this.currentType = 2;
                    break;
                }

                case 3:
                {
                    bool flag3 = ModelBase <PlayerModel> .getInstance().gold < ModelBase <OffLineModel> .getInstance().GetCost(3);

                    if (flag3)
                    {
                        flytxt.instance.fly(ContMgr.getCont("off_line_exp_gold", null), 0, default(Color), null);
                    }
                    else
                    {
                        bool isOn3 = this.fenjie.isOn;
                        if (isOn3)
                        {
                            BaseProxy <OffLineExpProxy> .getInstance().sendType(3, true);
                        }
                        else
                        {
                            BaseProxy <OffLineExpProxy> .getInstance().sendType(3, false);
                        }
                    }
                    this.currentType = 3;
                    break;
                }

                case 4:
                {
                    bool flag4 = ModelBase <PlayerModel> .getInstance().gold < ModelBase <OffLineModel> .getInstance().GetCost(4);

                    if (flag4)
                    {
                        flytxt.instance.fly(ContMgr.getCont("off_line_exp_gold", null), 0, default(Color), null);
                    }
                    else
                    {
                        bool isOn4 = this.fenjie.isOn;
                        if (isOn4)
                        {
                            BaseProxy <OffLineExpProxy> .getInstance().sendType(4, true);
                        }
                        else
                        {
                            BaseProxy <OffLineExpProxy> .getInstance().sendType(4, false);
                        }
                    }
                    this.currentType = 4;
                    break;
                }
                }
            }
        }
예제 #26
0
        private void OnClickToGetExp(int type)
        {
            A3_VipModel vipModel = A3_VipModel.getInstance();


            if (!offLineModel.CanGetExp)
            {
                flytxt.instance.fly(ContMgr.getCont("off_line_empty"));
                InterfaceMgr.getInstance().close(InterfaceMgr.OFFLINEEXP);
                a3_expbar.instance.getGameObjectByPath("operator/LightTips/btnAuto_off_line_exp").SetActive(false);
                return;
            }
            offline_item.Clear();
            offline = true;
            switch (type)
            {
            case 1:

                if (fenjie.isOn == true)
                {
                    OffLineExpProxy.getInstance().sendType(1, true);
                }
                else
                {
                    OffLineExpProxy.getInstance().sendType(1, false);
                }
                currentType = 1;
                break;

            case 2:

                if (PlayerModel.getInstance().money < OffLineModel.getInstance().GetCost(2))
                {
                    flytxt.instance.fly(ContMgr.getCont("off_line_exp_money"));
                }
                else
                {
                    if (fenjie.isOn == true)
                    {
                        OffLineExpProxy.getInstance().sendType(2, true);
                    }
                    else
                    {
                        OffLineExpProxy.getInstance().sendType(2, false);
                    }
                }
                currentType = 2;
                break;

            case 3:
                if (PlayerModel.getInstance().gold < OffLineModel.getInstance().GetCost(3))
                {
                    flytxt.instance.fly(ContMgr.getCont("off_line_exp_gold"));
                }
                //else if (vipModel.Level < vip_lite(3))
                //    flytxt.instance.fly(ContMgr.getCont("off_line_exp_vip"));
                else
                {
                    if (fenjie.isOn == true)
                    {
                        OffLineExpProxy.getInstance().sendType(3, true);
                    }
                    else
                    {
                        OffLineExpProxy.getInstance().sendType(3, false);
                    }
                }
                currentType = 3;
                break;

            case 4:
                if (PlayerModel.getInstance().gold < OffLineModel.getInstance().GetCost(4))
                {
                    flytxt.instance.fly(ContMgr.getCont("off_line_exp_gold"));
                }
                //else if (vipModel.Level < vip_lite(4))
                //    flytxt.instance.fly(ContMgr.getCont("off_line_exp_vip"));
                else
                {
                    if (fenjie.isOn == true)
                    {
                        OffLineExpProxy.getInstance().sendType(4, true);
                    }
                    else
                    {
                        OffLineExpProxy.getInstance().sendType(4, false);
                    }
                }
                currentType = 4;
                break;

            default:
                break;
            }
        }