Example #1
0
        public override void onShowed()
        {
            if (uiData != null && uiData.Count > 1)
            {
                //eqp1_id = (uint)uiData[0];
                //eqp2_id = (uint)uiData[1];
                //inheritType = (inheritType)uiData[2];
                //if (eqp2_id == eqp1_id)
                //{
                //    //InterfaceMgr.getInstance().close(InterfaceMgr.A3_EQPINHERIT);
                //    return;
                //}
                inheritinfo info = new inheritinfo();
                info.id1  = (uint)uiData[0];
                info.id2  = (uint)uiData[1];
                info.type = (inheritType)uiData[2];
                datalist.Add(info);
            }

            if (datalist.Count <= 0)
            {
                InterfaceMgr.getInstance().close(InterfaceMgr.A3_EQPINHERIT);
                return;
            }

            transform.SetAsLastSibling();
            EquipProxy.getInstance().addEventListener(EquipProxy.EVENT_EQUIP_INHERIT, onEquipInherit);
            SetShow();
        }
Example #2
0
        public override void init()
        {
            inText();
            eqpIcon1 = this.transform.FindChild("eqp1");
            eqpIcon2 = this.transform.FindChild("eqp2");
            new BaseButton(transform.FindChild("retun")).onClick  =
                new BaseButton(transform.FindChild("no")).onClick = (GameObject go) =>
            {
                a3_EquipModel.getInstance().Attchange_wite = false;
                a3_attChange.instans.runTxt(null);
                onover();
            };

            new BaseButton(transform.FindChild("yes")).onClick = (GameObject go) =>
            {
                if (inheritType == inheritType.eqp)
                {
                    EquipProxy.getInstance().sendInherit(eqp1_id, eqp2_id, 1, false);
                }
                else if (inheritType == inheritType.baoshi)
                {
                    EquipProxy.getInstance().sendInherit_baoshi(eqp1_id, eqp2_id);
                }
            };
        }
        void refreshShow(a3_BagItemData data)
        {
            Transform Image = this.transform.FindChild("bg/icon");

            if (Image.childCount > 0)
            {
                for (int i = 0; i < Image.childCount; i++)
                {
                    Destroy(Image.GetChild(i).gameObject);
                }
            }
            GameObject icon = IconImageMgr.getInstance().createA3ItemIcon(data);

            icon.transform.SetParent(Image, false);
            new BaseButton(this.transform.FindChild("bg/do")).onClick = (GameObject go) =>
            {
                if (data.isEquip)
                {
                    EquipProxy.getInstance().sendChangeEquip(data.id);
                }
                else if (data.confdata.use_type == 13)
                {
                    a3_BagModel.getInstance().useItemByTpid(data.confdata.tpid, 1);
                }
                else if (data.confdata.use_type == 20)//宠物在开启功能之前获得
                {
                    if (FunctionOpenMgr.instance.Check(FunctionOpenMgr.PET))
                    {
                        a3_BagModel.getInstance().useItemByTpid(data.confdata.tpid, 1);
                    }
                    else
                    {
                        flytxt.instance.fly(ContMgr.getCont("func_limit_8"));
                    }
                }
                else if (data.isSummon)
                {
                    A3_SummonProxy.getInstance().sendUseSummon((uint)data.id);
                }
            };
            new BaseButton(this.transform.FindChild("bg/close")).onClick = (GameObject go) =>
            {
                if (data.isEquip)
                {
                    a3_BagModel.getInstance().neweqp.Remove(data.id);
                }
                else if (data.confdata.use_type == 13 || data.confdata.use_type == 20)
                {
                    a3_BagModel.getInstance().newshow_item.Remove(data.id);
                }
                else if (data.isSummon)
                {
                    a3_BagModel.getInstance().newshow_summon.Remove(data.id);
                }
                showUse();
            };
        }
Example #4
0
        public override void onClosed()
        {
            EquipProxy.getInstance().removeEventListener(EquipProxy.EVENT_EQUIP_INHERIT, onEquipInherit);

            inheritType = inheritType._null;
            eqp1_id     = 0;
            eqp2_id     = 0;
            a3_EquipModel.getInstance().Attchange_wite = false;
        }
Example #5
0
 void Sendproxy(GameObject go)
 {
     dic_leftAllid.Clear();
     foreach (uint i in dic_BagItem.Keys)
     {
         dic_leftAllid.Add(i);
     }
     EquipProxy.getInstance().sendsell(dic_leftAllid);
     onfenjieclose(null);
     //this.transform.FindChild("piliang_fenjie").gameObject.SetActive(false);
 }
Example #6
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));
            }
        }