Exemplo n.º 1
0
        public override void init()
        {
            getComponentByPath <Text>("tabs/shuxing/Text").text = ContMgr.getCont("a3_summon_new_0");
            getComponentByPath <Text>("tabs/xilian/Text").text  = ContMgr.getCont("a3_summon_new_1");
            getComponentByPath <Text>("tabs/shouhun/Text").text = ContMgr.getCont("a3_summon_new_2");
            getComponentByPath <Text>("tabs/ronghe/Text").text  = ContMgr.getCont("a3_summon_new_3");
            getComponentByPath <Text>("tabs/tunshi/Text").text  = ContMgr.getCont("a3_summon_new_4");
            getComponentByPath <Text>("tabs/tujian/Text").text  = ContMgr.getCont("a3_summon_new_5");
            getComponentByPath <Text>("tabs/lianxie/Text").text = ContMgr.getCont("a3_summon_new_6");

            getInstance = this;
            model       = A3_SummonModel.getInstance();
            contents    = this.transform.FindChild("contents");
            Btns        = this.transform.FindChild("tabs");
            summonlist  = this.transform.FindChild("summonlist");
            summonVeiw  = summonlist.FindChild("summons/scroll/content");
            //selectframe = summonlist.FindChild("summons/scroll/frame").gameObject;
            smallwinCon = this.transform.FindChild("small_veiw");
            listCount   = this.transform.FindChild("summonlist/num").GetComponent <Text>();
            for (int i = 0; i < Btns.childCount; i++)
            {
                new BaseButton(Btns.GetChild(i)).onClick = (GameObject go) =>
                {
                    onTab(go.name);
                };
            }
            new BaseButton(this.transform.FindChild("btn_close")).onClick = (GameObject go) =>
            {
                InterfaceMgr.getInstance().close(InterfaceMgr.A3_SUMMON_NEW);
            };
            scrollControler = new ScrollControler();
            ScrollRect scroll = transform.FindChild("summonlist/summons/scroll").GetComponent <ScrollRect>();

            scrollControler.create(scroll);
        }
Exemplo n.º 2
0
        Variant canUplvl(int lvl, int exp)
        {
            Variant data   = new Variant();
            int     maxlvl = XMLMgr.instance.GetSXML("callbeast").GetNodeList("attribute").Count;

            if (lvl >= maxlvl)
            {
                if (exp >= A3_SummonModel.getInstance().GetAttributeXml(maxlvl).getInt("exp"))
                {
                    exp = A3_SummonModel.getInstance().GetAttributeXml(maxlvl).getInt("exp");
                }
                data["lvl"] = maxlvl;
                data["go"]  = false;
            }
            else
            {
                if (exp >= A3_SummonModel.getInstance().GetAttributeXml(lvl).getInt("exp"))
                {
                    exp       -= A3_SummonModel.getInstance().GetAttributeXml(lvl).getInt("exp");
                    lvl       += 1;
                    data["go"] = true;
                }
                else
                {
                    data["go"] = false;
                }
                data["lvl"] = lvl;
            }

            data["exp"] = exp;
            return(data);
        }
        void onlink(GameEvent v)
        {
            Transform  con  = r2.transform.FindChild("sumcon/summons/scroll/content");
            GameObject item = r2.transform.FindChild("sumcon/summons/scroll/0").gameObject;

            for (int i = 0; i < con.childCount; i++)
            {
                GameObject.Destroy(con.GetChild(i).gameObject);
            }
            summonObj.Clear();
            foreach (uint id in A3_SummonModel.getInstance().link_list)
            {
                a3_BagItemData data = A3_SummonModel.getInstance().GetSummons()[id];
                GameObject     clon = GameObject.Instantiate(item) as GameObject;
                clon.SetActive(true);
                clon.transform.SetParent(con.transform, false);
                clon.name = data.summondata.id.ToString();
                clon.transform.FindChild("articles").gameObject.SetActive(true);
                new BaseButton(clon.transform).onClick = (GameObject go) => {
                    getSummonWin().setCurSummonID((uint)data.summondata.id);
                    getSummonWin().setframe();
                    setframe();
                };
                summonObj[(uint)data.summondata.id] = clon;
                setSum_one((uint)data.summondata.id);
            }
            setframe();
            setBtn();
            refreSumlist((int)CurSummonID, true);
        }
Exemplo n.º 4
0
        void init()
        {
            tranObj.transform.FindChild("zhu/bg/title").GetComponent <Text>().text = ContMgr.getCont("a3_summon_ronghe_0");
            tranObj.transform.FindChild("fu/bg/title").GetComponent <Text>().text  = ContMgr.getCont("a3_summon_ronghe_1");
            tranObj.transform.FindChild("todo/Text").GetComponent <Text>().text    = ContMgr.getCont("a3_summon_ronghe_2");


            new BaseButton(tranObj.transform.FindChild("fu/Button")).onClick = (GameObject go) =>
            {
                if (getSummonWin() == null)
                {
                    return;
                }
                GameObject plan = getSummonWin().GetSmallWin("uilayer_tofusum_summon");
                plan.transform.FindChild("top").GetComponent <Text>().text = ContMgr.getCont("tofusum_summon_0");
                plan.SetActive(true);
                setFuSumlist(plan);
            };

            new BaseButton(tranObj.transform.FindChild("todo")).onClick = (GameObject go) =>
            {
                if (getSummonWin() == null)
                {
                    return;
                }
                if (!A3_SummonModel.getInstance().GetSummons().ContainsKey(fuSumID))
                {
                    flytxt.instance.fly(ContMgr.getCont("summon_selete_ronghe"));
                    return;
                }
                GameObject toSrue = getSummonWin().GetSmallWin("uilayer_ToSure_summon");
                toSrue.SetActive(true);
                setSure(toSrue);
            };
        }
Exemplo n.º 5
0
        public override void onClosed()
        {
            this.transform.FindChild("btn_stone/cnt").gameObject.SetActive(true);
            this.transform.FindChild("btn_stone/icon").gameObject.SetActive(true);
            this.transform.FindChild("btn_gld/cnt").gameObject.SetActive(true);
            this.transform.FindChild("btn_gld/icon").gameObject.SetActive(true);
            this.transform.FindChild("btn_gld/Text").gameObject.SetActive(true);
            this.transform.FindChild("btn_gld/Text").gameObject.SetActive(true);

            InterfaceMgr.getInstance().floatUI.localScale = Vector3.one;
            if (GameObject.Find("GAME_CAMERA/myCamera"))
            {
                GameObject cameraOBJ = GameObject.Find("GAME_CAMERA/myCamera");
                if (cameraOBJ.GetComponent <DeathShader>())
                {
                    cameraOBJ.GetComponent <DeathShader>().enabled = false;
                }
            }
            instans = null;

            if (A3_SummonModel.getInstance().GetSummons().ContainsKey(A3_SummonModel.getInstance().toAttackID))
            {
                A3_SummonProxy.getInstance().sendChuzhan(A3_SummonModel.getInstance().toAttackID);
                A3_SummonModel.getInstance().toAttackID = 0;
            }
        }
Exemplo n.º 6
0
 virtual public void onCurSummonIdChange()
 {
     if (getSummonWin().CurTranType != 0)
     {
         if (!A3_SummonModel.getInstance().Checklvl(getSummonWin().CurTranType, CurSummonID))
         {
             getSummonWin().black_Tab();
         }
     }
 }
 public void setSum_one(uint id)
 {
     if (summonObj.ContainsKey(id))
     {
         a3_BagItemData it = A3_SummonModel.getInstance().GetSummons()[id];
         summonObj[id].transform.FindChild("lv").GetComponent <Text>().text = it.summondata.level.ToString();
         SetIcon(it, summonObj[id].transform.FindChild("icon"));
         setStar(summonObj[id].transform.FindChild("stars"), it.summondata.star);
     }
 }
Exemplo n.º 8
0
        void init()
        {
            tranObj.transform.FindChild("info_/Image/Text").GetComponent <Text>().text      = ContMgr.getCont("a3_summon_tunshi_0");
            tranObj.transform.FindChild("info_/Text").GetComponent <Text>().text            = ContMgr.getCont("a3_summon_tunshi_1");
            tranObj.transform.FindChild("info_/lvCon/Text").GetComponent <Text>().text      = ContMgr.getCont("a3_summon_tunshi_2");
            tranObj.transform.FindChild("info_/shouhunCon/Text").GetComponent <Text>().text = ContMgr.getCont("a3_summon_tunshi_3");
            tranObj.transform.FindChild("info_/skillCon/Text").GetComponent <Text>().text   = ContMgr.getCont("a3_summon_tunshi_4");
            tranObj.transform.FindChild("info_yulan/Image/Text").GetComponent <Text>().text = ContMgr.getCont("a3_summon_tunshi_5");
            tranObj.transform.FindChild("info_yulan/lvl").GetComponent <Text>().text        = ContMgr.getCont("a3_summon_tunshi_6");
            tranObj.transform.FindChild("info_yulan/Text").GetComponent <Text>().text       = ContMgr.getCont("a3_summon_tunshi_3");
            tranObj.transform.FindChild("Button/Text").GetComponent <Text>().text           = ContMgr.getCont("a3_summon_tunshi_7");
            tranObj.transform.FindChild("todo/Text").GetComponent <Text>().text             = ContMgr.getCont("a3_summon_tunshi_8");
            tranObj.transform.FindChild("info_yulan/Text1").GetComponent <Text>().text      = ContMgr.getCont("a3_summon_tunshi_9");
            tranObj.transform.FindChild("help/Text").GetComponent <Text>().text             = ContMgr.getCont("a3_summon_tunshi_10"); //help提示
            tranObj.transform.FindChild("help/close/Text").GetComponent <Text>().text       = ContMgr.getCont("a3_summon_tunshi_11"); //知道了
            tishi   = tranObj.transform.FindChild("info_yulan/Text1").gameObject;
            helpcon = tranObj.transform.FindChild("help").gameObject;
            new BaseButton(tranObj.transform.FindChild("help_btn")).onClick = (GameObject go) => {
                helpcon.SetActive(true);
                getSummonWin().avatorobj.SetActive(false);
            };
            new BaseButton(helpcon.transform.FindChild("close")).onClick = (GameObject go) => {
                helpcon.SetActive(false);
                getSummonWin().avatorobj.SetActive(true);
            };
            SkillCon = tranObj.transform.FindChild("info_yulan/skills");
            getEventTrigerByPath("tach").onDrag = OnDrag;
            new BaseButton(tranObj.transform.FindChild("Button")).onClick = (GameObject go) =>
            {
                if (getSummonWin() == null)
                {
                    return;
                }
                GameObject plan = getSummonWin().GetSmallWin("uilayer_tofusum_summon");
                plan.transform.FindChild("top").GetComponent <Text>().text = ContMgr.getCont("tofusum_summon_0");
                plan.SetActive(true);
                setFuSumlist(plan);
            };
            new BaseButton(tranObj.transform.FindChild("todo")).onClick = (GameObject go) =>
            {
                if (getSummonWin() == null)
                {
                    return;
                }
                if (!A3_SummonModel.getInstance().GetSummons().ContainsKey(FuSum_Id))
                {
                    flytxt.instance.fly(ContMgr.getCont("summon_selete_sum"));
                    return;
                }
                GameObject toSrue = getSummonWin().GetSmallWin("uilayer_ToSure_summon");

                toSrue.SetActive(true);
                setSure(toSrue);
            };
        }
Exemplo n.º 9
0
 public void  refresh_sumCd(float time)
 {
     sum_cd.fillAmount = time / 20f;
     sum_cd.transform.FindChild("time").GetComponent <Text>().text = ((int)time).ToString();
     if (time <= 0)
     {
         sum_cd.gameObject.SetActive(false);
         do_sum_CD = false;
         A3_SummonProxy.getInstance().sendChuzhan(A3_SummonModel.getInstance().lastatkID);
     }
 }
Exemplo n.º 10
0
        void setGailvAndNeedMoney(bool nullsum = false)
        {
            Text gclv = tranObj.transform.FindChild("cglv").GetComponent <Text>();

            Text money = tranObj.transform.FindChild("todo/money").GetComponent <Text>();

            if (nullsum)
            {
                gclv.text  = "(" + ContMgr.getCont("chenggonglv") + "0%" + ")";
                money.text = 0.ToString();
            }
            else
            {
                if (A3_SummonModel.getInstance().GetSummons().ContainsKey(fuSumID) && A3_SummonModel.getInstance().GetSummons().ContainsKey(CurSummonID))
                {
                    a3_BagItemData curdata   = A3_SummonModel.getInstance().GetSummons()[CurSummonID];
                    a3_BagItemData fudata    = A3_SummonModel.getInstance().GetSummons()[fuSumID];
                    int            needmoney = 0;
                    needmoney  = sumXml.GetNode("combin_cost", "star==" + curdata.summondata.star).getInt("money");
                    money.text = needmoney.ToString();

                    int        rate  = sumXml.GetNode("success_rate").getInt("luck_add_mull");
                    int        cg1   = (int)((rate * curdata.summondata.luck) / 100);
                    int        cg2   = 0;
                    List <int> skill = new List <int>();
                    foreach (int id in curdata.summondata.skills.Keys)
                    {
                        if (!skill.Contains(id))
                        {
                            skill.Add(id);
                        }
                    }
                    foreach (int id in fudata.summondata.skills.Keys)
                    {
                        if (!skill.Contains(id))
                        {
                            skill.Add(id);
                        }
                    }
                    SXML        ra        = sumXml.GetNode("success_rate");
                    List <SXML> skilllixt = ra.GetNodeList("skill_count");

                    int _count = skill.Count;
                    if (skill.Count >= skilllixt.Count)
                    {
                        _count = skilllixt.Count;
                    }

                    cg2       = ra.GetNode("skill_count", "count==" + _count).getInt("rate");
                    gclv.text = "(" + ContMgr.getCont("chenggonglv") + (cg1 + cg2) + "%" + ")";
                }
            }
        }
        void SetNeedItem()
        {
            if (!A3_SummonModel.getInstance().GetSummons().ContainsKey(CurSummonID))
            {
                return;
            }
            a3_BagItemData data   = A3_SummonModel.getInstance().GetSummons()[CurSummonID];
            List <SXML>    reset  = sumXml.GetNodeList("reset");
            int            itemid = 0;
            int            num    = 0;

            foreach (SXML it in reset)
            {
                if (data.summondata.star == it.getInt("star"))
                {
                    itemid     = it.getInt("need_item_id");
                    NeedItemId = itemid;
                    num        = it.getInt("need_item_sum");
                    break;
                }
            }
            if (itemid > 0 && num != 0)
            {
                for (int i = 0; i < tranObj.transform.FindChild("needitem/icon").childCount; i++)
                {
                    GameObject.Destroy(tranObj.transform.FindChild("needitem/icon").GetChild(i).gameObject);
                }
                a3_ItemData itemdata = a3_BagModel.getInstance().getItemDataById((uint)itemid);
                GameObject  icon     = IconImageMgr.getInstance().createA3ItemIcon(itemdata);
                icon.transform.SetParent(tranObj.transform.FindChild("needitem/icon"), false);
                new BaseButton(icon.transform).onClick = (GameObject go) =>
                {
                    ArrayList arr = new ArrayList();
                    arr.Add((uint)itemid);
                    arr.Add(1);
                    InterfaceMgr.getInstance().ui_async_open(InterfaceMgr.A3_MINITIP, arr);
                };
                int haveCount = a3_BagModel.getInstance().getItemNumByTpid((uint)itemid);
                if (num <= haveCount)
                {
                    tranObj.transform.FindChild("needitem/count").GetComponent <Text>().text = "<color=#00FF56FF>" + haveCount + "/" + num + "</color>";
                    //tranObj.transform.FindChild("todo").GetComponent<Button>().interactable = true;
                    CanDo_change = true;
                }
                else
                {
                    tranObj.transform.FindChild("needitem/count").GetComponent <Text>().text = "<color=#f90e0e>" + haveCount + "/" + num + "</color>";
                    //tranObj.transform.FindChild("todo").GetComponent<Button>().interactable = false;
                    CanDo_change = false;
                }
            }
        }
Exemplo n.º 12
0
        void SetCurSumInfo()
        {
            if (!A3_SummonModel.getInstance().GetSummons().ContainsKey(CurSummonID))
            {
                return;
            }
            a3_BagItemData data = A3_SummonModel.getInstance().GetSummons()[CurSummonID];

            tranObj.transform.FindChild("zhu/lv").GetComponent <Text>().text        = data.summondata.level.ToString();
            tranObj.transform.FindChild("zhu/name").GetComponent <Text>().text      = data.summondata.name;
            tranObj.transform.FindChild("zhu/zhanlimun").GetComponent <Text>().text = data.summondata.power.ToString();
            for (int m = 0; m < tranObj.transform.FindChild("zhu/icon").childCount; m++)
            {
                GameObject.Destroy(tranObj.transform.FindChild("zhu/icon").GetChild(m).gameObject);
            }
            GameObject icon = IconImageMgr.getInstance().createA3ItemIcon(data.confdata);

            icon.transform.SetParent(tranObj.transform.FindChild("zhu/icon"), false);
            Transform SkillCon = tranObj.transform.FindChild("zhu/skills");

            for (int i = 0; i < SkillCon.childCount; i++)
            {
                SkillCon.GetChild(i).FindChild("icon/icon").gameObject.SetActive(false);
                SkillCon.GetChild(i).FindChild("lock").gameObject.SetActive(true);
            }
            int idner = 1;

            foreach (summonskill skill in data.summondata.skills.Values)
            {
                Transform skillCell = SkillCon.FindChild(idner.ToString());
                skillCell.FindChild("icon/icon").gameObject.SetActive(true);
                skillCell.FindChild("lock").gameObject.SetActive(false);
                SXML xx = XMLMgr.instance.GetSXML("skill.skill", "id==" + skill.skillid);
                skillCell.FindChild("icon/icon").GetComponent <Image>().sprite = GAMEAPI.ABUI_LoadSprite("icon_smskill_" + xx.getInt("icon"));
                new BaseButton(skillCell).onClick = (GameObject go) => {
                    if (getSummonWin() == null)
                    {
                        return;
                    }
                    if (skillCell.FindChild("icon/icon").gameObject.activeSelf == false)
                    {
                        return;
                    }
                    GameObject tip = getSummonWin().GetSmallWin("uilayer_skilltip_summon");
                    tip.transform.FindChild("Text").GetComponent <Text>().text       = ContMgr.getCont("skilltip_summon_0");
                    tip.transform.FindChild("black/Text").GetComponent <Text>().text = ContMgr.getCont("ToSure_summon_1");
                    tip.SetActive(true);
                    setskilltip(tip, skill);
                };
                idner++;
            }
        }
Exemplo n.º 13
0
        public void sendZHSummon(uint tpid)
        {
            Variant msg = new Variant();

            msg["tp"]   = 1;
            msg["tpid"] = tpid;
            if (A3_SummonModel.getInstance().GetSummons().Count >= 50)
            {
                flytxt.instance.fly(ContMgr.getCont("A3_SummonProxy_bagmax"));
            }
            sendRPC(PKG_NAME.S2C_SUMMON_OPERATION_RES, msg);
            debug.Log(msg.dump());
        }
 void setBtn()
 {
     if (A3_SummonModel.getInstance().link_list.Contains(CurSummonID))
     {
         r2.transform.FindChild("cancel").gameObject.SetActive(true);
         r2.transform.FindChild("Battle").gameObject.SetActive(false);
     }
     else
     {
         r2.transform.FindChild("cancel").gameObject.SetActive(false);
         r2.transform.FindChild("Battle").gameObject.SetActive(true);
     }
 }
Exemplo n.º 15
0
 void setSure(GameObject pre)
 {
     new BaseButton(pre.transform.FindChild("yes")).onClick = (GameObject go) =>
     {
         if (A3_SummonModel.getInstance().GetSummons().ContainsKey(fuSumID))
         {
             A3_SummonProxy.getInstance().sendRonghe(CurSummonID, fuSumID);
             pre.SetActive(false);
         }
     };
     pre.transform.FindChild("top").GetComponent <Text>().text = ContMgr.getCont("summon_sure_top_1");
     pre.transform.FindChild("txt").GetComponent <Text>().text = StringUtils.formatText(ContMgr.getCont("summon_sure_text_1"));
 }
Exemplo n.º 16
0
        void setshouhun_lvl()
        {
            if (!A3_SummonModel.getInstance().GetSummons().ContainsKey(CurSummonID))
            {
                return;
            }
            a3_BagItemData data = A3_SummonModel.getInstance().GetSummons()[CurSummonID];

            for (int i = 1; i <= con.childCount; i++)
            {
                soulObj[i].transform.FindChild("lvl").GetComponent <Text>().text = data.summondata.shouhun[i].lvl.ToString();
            }
        }
Exemplo n.º 17
0
        void Update()
        {
            if (do_sum_CD && A3_SummonModel.getInstance().getSumCds().ContainsKey((int)A3_SummonModel.getInstance().lastatkID))
            {
                refresh_sumCd(A3_SummonModel.getInstance().getSumCds()[(int)A3_SummonModel.getInstance().lastatkID]);
            }


            if (Input.GetKeyDown(KeyCode.Escape))
            {
                GameSdkMgr.record_quit();
            }
        }
Exemplo n.º 18
0
 public void refreshZHSlist_chuzhan()
 {
     foreach (uint idd in summonObj.Keys)
     {
         if (idd == A3_SummonModel.getInstance().nowShowAttackID)
         {
             summonObj[idd].transform.FindChild("fighting").gameObject.SetActive(true);
         }
         else
         {
             summonObj[idd].transform.FindChild("fighting").gameObject.SetActive(false);
         }
     }
 }
Exemplo n.º 19
0
        void setAvator()
        {
            if (CurSummonID <= 0)
            {
                return;
            }
            if (!A3_SummonModel.getInstance().GetSummons().ContainsKey(CurSummonID))
            {
                return;
            }
            a3_BagItemData sum = A3_SummonModel.getInstance().GetSummons()[CurSummonID];

            SetDispose();
            SXML       xml        = sumXml.GetNode("callbeast", "id==" + sum.tpid);
            int        mid        = xml.getInt("mid");
            SXML       mxml       = XMLMgr.instance.GetSXML("monsters.monsters", "id==" + mid);
            int        objid      = mxml.getInt("obj");
            GameObject obj_prefab = GAMEAPI.ABModel_LoadNow_GameObject("monster_" + objid);
            float      y          = float.Parse(mxml.getString("smshow_pos"));

            getSummonWin().avatorobj = GameObject.Instantiate(obj_prefab, new Vector3(-153.632f, 0.778f + y, 0f), Quaternion.identity) as GameObject;
            foreach (Transform tran in getSummonWin().avatorobj.GetComponentsInChildren <Transform>())
            {
                tran.gameObject.layer = EnumLayer.LM_FX;// 更改物体的Layer层
            }
            Transform cur_model = getSummonWin().avatorobj.transform.FindChild("model");
            var       animm     = cur_model.GetComponent <Animator>();

            animm.cullingMode = AnimatorCullingMode.AlwaysAnimate;
            cur_model.gameObject.AddComponent <Summon_Base_Event>();
            cur_model.Rotate(Vector3.up, 270 - mxml.getInt("smshow_face"));
            float scale = mxml.getFloat("smshow_scale");

            if (scale < 0)
            {
                scale = 0.5f;
            }
            cur_model.transform.localScale = new Vector3(scale, scale, scale);
            GameObject t_prefab = GAMEAPI.ABFight_LoadPrefab("model_avatar_ui_roleinfo_ui_camera");

            getSummonWin().camobj = GameObject.Instantiate(t_prefab) as GameObject;
            Camera cam = getSummonWin().camobj.GetComponentInChildren <Camera>();

            if (cam != null)
            {
                float r_size = cam.orthographicSize * 1920 / 1080 * Screen.height / Screen.width;
                cam.orthographicSize = r_size;
            }
        }
Exemplo n.º 20
0
        void setFuSumlist(GameObject obj)
        {
            Transform  Con  = obj.transform.FindChild("summonlist/summons/scroll/content");
            GameObject item = obj.transform.FindChild("summonlist/summons/scroll/0").gameObject;

            obj.transform.FindChild("top").GetComponent <Text>().text = ContMgr.getCont("selsctfusummon");
            Dictionary <uint, a3_BagItemData> sT = A3_SummonModel.getInstance().GetSummons(true);

            for (int i = 0; i < Con.transform.childCount; i++)
            {
                GameObject.Destroy(Con.transform.GetChild(i).gameObject);
            }

            foreach (a3_BagItemData it in sT.Values)
            {
                if ((uint)it.summondata.id == A3_SummonModel.getInstance().nowShowAttackID)
                {
                    continue;
                }
                if ((uint)it.summondata.id == CurSummonID)
                {
                    continue;
                }
                GameObject clon = GameObject.Instantiate(item) as GameObject;
                clon.SetActive(true);
                clon.transform.SetParent(Con, false);

                clon.transform.FindChild("name").GetComponent <Text>().text = it.summondata.name;
                clon.transform.FindChild("lv").GetComponent <Text>().text   = it.summondata.level.ToString();
                GameObject icon = IconImageMgr.getInstance().createA3ItemIcon(it.confdata);
                icon.transform.SetParent(clon.transform.FindChild("icon"), false);
                Transform starRoot = clon.transform.FindChild("stars");
                for (int i = 0; i < 5; i++)
                {
                    starRoot.GetChild(i).FindChild("b").gameObject.SetActive(false);
                }

                for (int j = 0; j < it.summondata.star; j++)
                {
                    starRoot.GetChild(j).FindChild("b").gameObject.SetActive(true);
                }
                new BaseButton(clon.transform).onClick = (GameObject go) => {
                    setFuID(it.id);
                    closeWin("uilayer_tofusum_summon");
                };
            }
            Con.GetComponent <RectTransform>().anchoredPosition = Vector2.zero;
        }
Exemplo n.º 21
0
        public void setmoney()
        {
            Text money = tranObj.transform.FindChild("todo/money").GetComponent <Text>();

            if (A3_SummonModel.getInstance().GetSummons().ContainsKey(CurSummonID) && A3_SummonModel.getInstance().GetSummons().ContainsKey(FuSum_Id))
            {
                a3_BagItemData curdata   = A3_SummonModel.getInstance().GetSummons()[CurSummonID];
                int            needmoney = 0;
                needmoney  = sumXml.GetNode("combin_cost", "star==" + curdata.summondata.star).getInt("money");
                money.text = needmoney.ToString();
            }
            else
            {
                money.text = 0.ToString();
            }
        }
        void SetCurSuminfo()
        {
            if (!A3_SummonModel.getInstance().GetSummons().ContainsKey(CurSummonID))
            {
                return;
            }
            a3_BagItemData data = A3_SummonModel.getInstance().GetSummons()[CurSummonID];

            // tranObj.transform.FindChild("old/name").GetComponent<Text>().text = data.summondata.name;

            int count = tranObj.transform.FindChild("old/icon").childCount;

            for (int i = 0; i < count; i++)
            {
                GameObject.Destroy(tranObj.transform.FindChild("old/icon").GetChild(i).gameObject);
            }
            data.confdata.borderfile = "icon_itemborder_b039_0" + (data.summondata.star);
            GameObject icon = IconImageMgr.getInstance().createA3ItemIcon(data.confdata, false, -1, 1, false, -1, 0, false, false);

            icon.transform.SetParent(tranObj.transform.FindChild("old/icon"), false);
            SXML xml    = sumXml.GetNode("callbeast", "id==" + data.summondata.tpid);
            SXML attxml = xml.GetNode("star", "star_sum==" + data.summondata.star);

            tranObj.transform.FindChild("old/gongji/value").GetComponent <Text>().text  = data.summondata.attNatural + "/" + attxml.GetNode("att").getInt("reset_max");
            tranObj.transform.FindChild("old/fangyu/value").GetComponent <Text>().text  = data.summondata.defNatural + "/" + attxml.GetNode("def").getInt("reset_max");
            tranObj.transform.FindChild("old/minjie/value").GetComponent <Text>().text  = data.summondata.agiNatural + "/" + attxml.GetNode("agi").getInt("reset_max");
            tranObj.transform.FindChild("old/tili/value").GetComponent <Text>().text    = data.summondata.conNatural + "/" + attxml.GetNode("con").getInt("reset_max");
            tranObj.transform.FindChild("old/xingyun/value").GetComponent <Text>().text = data.summondata.luck.ToString();

            float attValue = (float)data.summondata.attNatural / (float)attxml.GetNode("att").getInt("reset_max");
            float defValue = (float)data.summondata.defNatural / (float)attxml.GetNode("def").getInt("reset_max");
            float agiValue = (float)data.summondata.agiNatural / (float)attxml.GetNode("agi").getInt("reset_max");
            float conValue = (float)data.summondata.conNatural / (float)attxml.GetNode("con").getInt("reset_max");

            tranObj.transform.FindChild("old/gongji/slider").GetComponent <Image>().fillAmount = attValue;
            tranObj.transform.FindChild("old/fangyu/slider").GetComponent <Image>().fillAmount = defValue;
            tranObj.transform.FindChild("old/minjie/slider").GetComponent <Image>().fillAmount = agiValue;
            tranObj.transform.FindChild("old/tili/slider").GetComponent <Image>().fillAmount   = conValue;

            int allValue = (int)(((attValue + defValue + agiValue + conValue) / 4) * 100);

            tranObj.transform.FindChild("old/value").GetComponent <Text>().text = allValue + "%";

            curSummon_wmd = allValue;
        }
Exemplo n.º 23
0
        // public uint nowsum_id = 0;

        public void refresh_sumbar()
        {
            if (A3_SummonModel.getInstance().GetSummons().Count <= 0)
            {
                this.transform.FindChild("info/summon").gameObject.SetActive(false);
                return;
            }
            else
            {
                this.transform.FindChild("info/summon").gameObject.SetActive(true);
                this.transform.FindChild("info/summon/bg/icon").gameObject.SetActive(false);
                this.transform.FindChild("info/summon/bg/add").gameObject.SetActive(false);
                sum_cd.gameObject.SetActive(false);
            }

            if (A3_SummonModel.getInstance().nowShowAttackID > 0 && A3_SummonModel.getInstance().GetSummons().ContainsKey(A3_SummonModel.getInstance().nowShowAttackID))
            {
                a3_BagItemData m_AttData = A3_SummonModel.getInstance().GetSummons()[A3_SummonModel.getInstance().nowShowAttackID];
                int            typeid    = m_AttData.summondata.tpid;
                var            x         = XMLMgr.instance.GetSXML("item.item", "id==" + typeid);
                this.transform.FindChild("info/summon/bg/icon").GetComponent <Image>().sprite = GAMEAPI.ABUI_LoadSprite("icon_sm_ft_head_" + x.getString("icon_file"));
                this.transform.FindChild("info/summon/bg/icon").gameObject.SetActive(true);
                refresh_sumSm(m_AttData.summondata.lifespan, 100);
                //当前有出战
            }
            else if (A3_SummonModel.getInstance().lastatkID > 0 && A3_SummonModel.getInstance().GetSummons().ContainsKey(A3_SummonModel.getInstance().lastatkID))
            {
                a3_BagItemData m_AttData1 = A3_SummonModel.getInstance().GetSummons()[A3_SummonModel.getInstance().lastatkID];
                refresh_sumSm(m_AttData1.summondata.lifespan, 100);
                refresh_sumHp(0, 1);
                this.transform.FindChild("info/summon/bg/icon").gameObject.SetActive(true);
                sum_cd.gameObject.SetActive(true);
                do_sum_CD = true;
                //当前没有出战,但有上次出战记录
            }
            else
            {
                refresh_sumSm(0, 100);
                refresh_sumHp(0, 1);
                this.transform.FindChild("info/summon/bg/add").gameObject.SetActive(true);
                //当前没出战,且没有出战记录
            }
        }
        public void ongetsum(a3_BagItemData data)
        {
            GameObject plan = getSummonWin().GetSmallWin("uilayer_getsummon");

            plan.SetActive(true);
            setGetAvator(data.summondata.tpid);
            setinfo_look(data, plan);
            new BaseButton(plan.transform.FindChild("use")).onClick = (GameObject go) =>
            {
                if (A3_SummonModel.getInstance().GetSummons().Count >= A3_SummonModel.getInstance().allcount)
                {
                    flytxt.instance.fly(ContMgr.getCont("a3_summon_liebiaoyiman"));
                }
                else
                {
                    A3_SummonProxy.getInstance().sendUseSummon((uint)data.id);
                }
                plan.SetActive(false);
                if (getSummonWin().avator_look != null)
                {
                    GameObject.Destroy(getSummonWin().avator_look);
                }
                if (getSummonWin().avatorobj&& !getSummonWin().avatorobj.activeSelf)
                {
                    getSummonWin().avatorobj.SetActive(true);
                }
            };
            new BaseButton(plan.transform.FindChild("putbag")).onClick = (GameObject go) =>
            {
                flytxt.instance.fly(ContMgr.getCont("a3_summon_putbag"));
                plan.SetActive(false);
                if (getSummonWin().avator_look != null)
                {
                    GameObject.Destroy(getSummonWin().avator_look);
                }
                if (getSummonWin().avatorobj&& !getSummonWin().avatorobj.activeSelf)
                {
                    getSummonWin().avatorobj.SetActive(true);
                }
            };
        }
        bool CheckSummon()
        {
            bool canlink = false;

            foreach (a3_BagItemData sm in A3_SummonModel.getInstance().GetSummons().Values)
            {
                if (canlink)
                {
                    break;
                }
                foreach (int idx in sm.summondata.linkdata.Keys)
                {
                    if (sm.summondata.linkdata[idx].type != 0)
                    {
                        canlink = true;
                        break;
                    }
                }
            }
            return(canlink);
        }
Exemplo n.º 26
0
 void setSure(GameObject pre)
 {
     if (getSummonWin().avatorobj != null)
     {
         getSummonWin().avatorobj.SetActive(false);
     }
     new BaseButton(pre.transform.FindChild("yes")).onClick = (GameObject go) =>
     {
         if (A3_SummonModel.getInstance().GetSummons().ContainsKey(FuSum_Id))
         {
             A3_SummonProxy.getInstance().sendtunshi(CurSummonID, FuSum_Id);
             pre.SetActive(false);
             if (getSummonWin().avatorobj != null)
             {
                 getSummonWin().avatorobj.SetActive(true);
             }
         }
     };
     pre.transform.FindChild("top").GetComponent <Text>().text = ContMgr.getCont("summon_sure_top_2");
     pre.transform.FindChild("txt").GetComponent <Text>().text = StringUtils.formatText(ContMgr.getCont("summon_sure_text_2"));
 }
        void setInfo()
        {
            if (!A3_SummonModel.getInstance().GetSummons().ContainsKey(CurSummonID))
            {
                return;
            }
            a3_BagItemData data = A3_SummonModel.getInstance().GetSummons()[CurSummonID];

            tranObj.transform.FindChild("r1/info/lvl").GetComponent <Text>().text    = "LV " + data.summondata.level;
            tranObj.transform.FindChild("r1/info/name").GetComponent <Text>().text   = data.summondata.name;
            tranObj.transform.FindChild("r1/info/zhanli").GetComponent <Text>().text = data.summondata.power.ToString();

            tranObj.transform.FindChild("r1/info/att/life/Text").GetComponent <Text>().text              = data.summondata.maxhp.ToString();
            tranObj.transform.FindChild("r1/info/att/phyatk/Text").GetComponent <Text>().text            = data.summondata.min_attack + "-" + data.summondata.max_attack;
            tranObj.transform.FindChild("r1/info/att/phydef/Text").GetComponent <Text>().text            = data.summondata.physics_def.ToString();
            tranObj.transform.FindChild("r1/info/att/manadef/Text").GetComponent <Text>().text           = data.summondata.magic_def.ToString();
            tranObj.transform.FindChild("r1/info/att/hit/Text").GetComponent <Text>().text               = (float)data.summondata.physics_dmg_red / 10 + "%";
            tranObj.transform.FindChild("r1/info/att/manaatk/Text").GetComponent <Text>().text           = (float)data.summondata.magic_dmg_red / 10 + "%";
            tranObj.transform.FindChild("r1/info/att/crit/Text").GetComponent <Text>().text              = data.summondata.double_damage_rate.ToString();
            tranObj.transform.FindChild("r1/info/att/dodge/Text").GetComponent <Text>().text             = data.summondata.dodge.ToString();
            tranObj.transform.FindChild("r1/info/att/fatal_damage/Text").GetComponent <Text>().text      = (float)data.summondata.fatal_damage / 10 + "%";
            tranObj.transform.FindChild("r1/info/att/hitit/Text").GetComponent <Text>().text             = data.summondata.hit.ToString();
            tranObj.transform.FindChild("r1/info/att/reflect_crit_rate/Text").GetComponent <Text>().text = data.summondata.reflect_crit_rate.ToString();
        }
        void setInfo_lianxie()
        {
            if (!A3_SummonModel.getInstance().GetSummons().ContainsKey(CurSummonID))
            {
                return;
            }
            a3_BagItemData data = A3_SummonModel.getInstance().GetSummons()[CurSummonID];

            tranObj.transform.FindChild("r2/lvl").GetComponent <Text>().text    = "LV " + data.summondata.level;
            tranObj.transform.FindChild("r2/name").GetComponent <Text>().text   = data.summondata.name;
            tranObj.transform.FindChild("r2/Combpt").GetComponent <Text>().text = data.summondata.linkCombpt.ToString();
            for (int i = 0; i < attCon.childCount; i++)
            {
                attCon.GetChild(i).gameObject.SetActive(false);
            }
            int n = 1;

            foreach (int idx in data.summondata.linkdata.Keys)
            {
                attCon.FindChild("att" + n).gameObject.SetActive(true);
                attCon.FindChild("att" + n).FindChild("null").gameObject.SetActive(false);
                attCon.FindChild("att" + n).FindChild("att").gameObject.SetActive(false);
                if (data.summondata.linkdata[idx].type == 0)
                {
                    attCon.FindChild("att" + n).FindChild("null").gameObject.SetActive(true);
                }
                else
                {
                    attCon.FindChild("att" + n).FindChild("att").gameObject.SetActive(true);
                    int attvalue = (int)Math.Ceiling((A3_SummonModel.getInstance().getAttValue(data.summondata, data.summondata.linkdata[idx].type) * ((float)data.summondata.linkdata[idx].per / 100.00f)));

                    attCon.FindChild("att" + n).FindChild("att").GetComponent <Text>().text = Globle.getAttrAddById(data.summondata.linkdata[idx].type, attvalue);
                }
                n++;
            }
        }
Exemplo n.º 29
0
        public void onLoadItems(Variant data)
        {
            debug.Log("包裹On_C#" + data.dump());
            int res = data["res"];

            if (res < 0)
            {
                Globle.err_output(res);
                return;
            }
            switch (res)
            {
            case 0:
                //a3_BagModel.getInstance().item_num.Clear();
                //a3_BagModel.getInstance().getItems().Clear();
                a3_BagModel.getInstance().curi = data["curi"];
                Variant info = data["items"];
                foreach (Variant item in info._arr)
                {
                    a3_BagItemData itemData = new a3_BagItemData();
                    itemData.id      = item["id"];
                    itemData.tpid    = item["tpid"];
                    itemData.num     = item["cnt"];
                    itemData.bnd     = item["bnd"];
                    itemData.ismark  = item["mark"];
                    itemData.isEquip = false;
                    itemData.isNew   = false;
                    if (item.ContainsKey("intensify_lv"))
                    {
                        a3_EquipModel.getInstance().equipData_read(itemData, item);
                    }
                    if (item.ContainsKey("stone_att"))
                    {
                        itemData.isrunestone = true;
                        foreach (Variant i in item["stone_att"]._arr)
                        {
                            itemData.runestonedata.runeston_att = new Dictionary <int, int>();
                            int att_type  = i["att_type"];
                            int att_value = i["att_value"];
                            itemData.runestonedata.runeston_att[att_type] = att_value;
                        }
                    }
                    else
                    {
                        itemData.isrunestone = false;
                    }

                    if (item.ContainsKey("talent"))
                    {
                        itemData = A3_SummonModel.getInstance().GetSummonData(itemData, item);
                    }
                    a3_BagModel.getInstance().addItem(itemData);
                    //if (a3_BagModel.getInstance().item_num.ContainsKey(itemData.tpid))
                    //{
                    //    itemData.num = a3_BagModel.getInstance().item_num[itemData.tpid].num + itemData.num;
                    //    a3_BagModel.getInstance().item_num.Remove(itemData.tpid);

                    //    a3_BagModel.getInstance().item_num.Add(itemData.tpid, itemData);
                    //}
                    //else
                    //{
                    //    a3_BagModel.getInstance().item_num.Add(itemData.tpid, itemData);
                    //}
                    if (a3_legion_info.mInstance != null)
                    {
                        a3_legion_info.mInstance.buff_up();
                    }
                }
                dispatchEvent(GameEvent.Create(EVENT_LOAD_BAG, this, null));
                InterfaceMgr.doCommandByLua("a1_low_fightgame.bag_Count", "ui/interfaces/low/a1_low_fightgame", a3_BagModel.getInstance().curi, a3_BagModel.getInstance().getItems().Count);
                break;

            case 1:
                a3_BagModel.getInstance().getHouseItems().Clear();
                a3_BagModel.getInstance().house_curi = data["curi"];
                Variant info1 = data["items"];
                foreach (Variant item in info1._arr)
                {
                    a3_BagItemData itemData = new a3_BagItemData();
                    itemData.id      = item["id"];
                    itemData.tpid    = item["tpid"];
                    itemData.num     = item["cnt"];
                    itemData.bnd     = item["bnd"];
                    itemData.ismark  = item["mark"];
                    itemData.isEquip = false;
                    if (item.ContainsKey("intensify_lv"))
                    {
                        a3_EquipModel.getInstance().equipData_read(itemData, item);
                    }
                    a3_BagModel.getInstance().addHouseItem(itemData);
                }

                //InterfaceMgr.getInstance().openUiFirstTime();
                break;

            case 2:
                a3_BagModel.getInstance().curi = data["unlock_num"];
                dispatchEvent(GameEvent.Create(EVENT_OPEN_BAGLOCK, this, null));
                InterfaceMgr.doCommandByLua("a1_low_fightgame.bag_Count", "ui/interfaces/low/a1_low_fightgame", a3_BagModel.getInstance().curi, a3_BagModel.getInstance().getItems().Count);
                if (a3_expbar.instance != null)
                {
                    a3_expbar.instance.bag_Count();
                }
                break;

            case 3:
                a3_BagModel.getInstance().house_curi = data["unlock_num"];
                dispatchEvent(GameEvent.Create(EVENT_OPEN_HOUSELOCK, this, null));
                break;

            case 4:
                if (data.ContainsKey("add"))
                {
                    Variant info2 = data["add"];
                    foreach (Variant item in info2._arr)
                    {
                        a3_BagItemData itemData = new a3_BagItemData();
                        itemData.id      = item["id"];
                        itemData.tpid    = item["tpid"];
                        itemData.num     = item["cnt"];
                        itemData.bnd     = item["bnd"];
                        itemData.isEquip = false;
                        if (item.ContainsKey("intensify_lv"))
                        {
                            a3_EquipModel.getInstance().equipData_read(itemData, item);
                        }
                        a3_BagModel.getInstance().addHouseItem(itemData);
                    }
                }
                if (data.ContainsKey("modcnts"))
                {
                    Variant info3 = data["modcnts"];
                    foreach (Variant item in info3._arr)
                    {
                        a3_BagItemData itemData = new a3_BagItemData();
                        itemData.id   = item["id"];
                        itemData.tpid = item["tpid"];
                        itemData.num  = item["cnt"];
                        //itemData.bnd = item["bnd"];
                        itemData.isEquip = false;
                        if (item.ContainsKey("intensify_lv"))
                        {
                            a3_EquipModel.getInstance().equipData_read(itemData, item);
                        }
                        a3_BagModel.getInstance().addHouseItem(itemData);
                    }
                }
                if (data.ContainsKey("rmvids"))
                {
                    Variant info4 = data["rmvids"];
                    foreach (uint id in info4._arr)
                    {
                        a3_BagModel.getInstance().removeHouseItem(id);
                    }
                }

                dispatchEvent(GameEvent.Create(EVENT_ROOM_TURN, this, data));
                break;

            case 6:
                uint           itemId = data["id"];
                a3_BagItemData one1   = a3_EquipModel.getInstance().getEquipByAll(itemId);
                one1.ismark = data["mark"];
                if (a3_BagModel.getInstance().getItems().ContainsKey(itemId))
                {
                    a3_BagModel.getInstance().addItem(one1);
                }
                if (a3_EquipModel.getInstance().getEquips().ContainsKey(itemId))
                {
                    a3_EquipModel.getInstance().addEquip(one1);
                }
                a3_BagModel.getInstance().isFirstMark = false;
                if (a3_equiptip.instans)
                {
                    a3_equiptip.instans.IsfirstMark();
                }
                if (a3_bag.indtans)
                {
                    a3_bag.indtans.refreshMark(itemId);
                }
                break;
            }
        }
Exemplo n.º 30
0
        void onItemChange(Variant data)
        {
            debug.Log(data.dump() + ":::::::::::::::");
            //  Debug.LogError(a3_BagModel.getInstance().item_num[1540].num);
            if (data.ContainsKey("money") || data.ContainsKey("yb") || data.ContainsKey("bndyb"))
            {//金钱变化
                if (data.ContainsKey("money"))
                {
                    if (data["money"] > PlayerModel.getInstance().money)
                    {
                        //if(a3_insideui_fb.instance == null)
                        flytxt.instance.fly(ContMgr.getCont("BagProxy_money") + (data["money"] - PlayerModel.getInstance().money));

                        if (a3_insideui_fb.instance != null && data.Count == 1)
                        {
                            a3_insideui_fb.instance.SetInfMoney((int)(data["money"] - PlayerModel.getInstance().money));
                            //BaseRoomItem.instance.goldnum = (data["money"] - PlayerModel.getInstance().money);
                            //debug.Log("ssssssssssssssssssssssssddd+" + BaseRoomItem.instance.goldnum);
                        }
                    }
                    else
                    {
                        debug.Log("消耗金币" + (PlayerModel.getInstance().money - data["money"]));
                        skill_a3.upgold = (int)(PlayerModel.getInstance().money - data["money"]);
                    }
                    PlayerModel.getInstance().money = data["money"];
                }
                if (data.ContainsKey("yb"))//钻石
                {
                    uint lastgold = PlayerModel.getInstance().gold;
                    PlayerModel.getInstance().gold = data["yb"];
                    if (lastgold < data["yb"] && HttpAppMgr.instance != null && HttpAppMgr.instance.giftCard != null)
                    {
                        HttpAppMgr.instance.giftCard.getFirstRechangeCard();
                        HttpAppMgr.instance.giftCard.getRechangeCard();
                    }
                }
                if (data.ContainsKey("bndyb"))
                {
                    PlayerModel.getInstance().gift = data["bndyb"];
                }
                UIClient.instance.dispatchEvent(GameEvent.Create(UI_EVENT.ON_MONEY_CHANGE, this, data));
            }
            bool new_itm = true;

            if (data.ContainsKey("new_itm"))
            {
                new_itm = data["new_itm"];
            }
            if (data.ContainsKey("add"))
            {
                //a3_BagModel.getInstance().removetype();
                int     m    = 0;
                Variant info = data["add"];
                foreach (Variant item in info._arr)
                {
                    a3_BagItemData itemData = new a3_BagItemData();
                    itemData.id   = item["id"];
                    itemData.tpid = item["tpid"];
                    itemData.num  = item["cnt"];
                    itemData.bnd  = item["bnd"];

                    if (a3_BagModel.getInstance().Items.ContainsKey(item["id"]))
                    {
                        m = a3_BagModel.getInstance().Items[item["id"]].num;
                    }
                    if (item.ContainsKey("mark"))
                    {
                        itemData.ismark = item["mark"];
                    }
                    itemData.isEquip = false;
                    if (new_itm)
                    {
                        itemData.isNew = true;
                    }
                    else
                    {
                        itemData.isNew = false;
                    }
                    if (item.ContainsKey("stone_att"))
                    {
                        itemData.isrunestone = true;
                        foreach (Variant i in item["stone_att"]._arr)
                        {
                            itemData.runestonedata.runeston_att = new Dictionary <int, int>();
                            int att_type  = i["att_type"];
                            int att_value = i["att_value"];
                            itemData.runestonedata.runeston_att[att_type] = att_value;
                        }
                    }
                    else
                    {
                        itemData.isrunestone = false;
                    }
                    if (item.ContainsKey("intensify_lv"))
                    {
                        a3_EquipModel.getInstance().equipData_read(itemData, item);
                    }
                    if (item.ContainsKey("talent"))
                    {
                        itemData.isSummon = true;
                        itemData          = A3_SummonModel.getInstance().GetSummonData(itemData, item);
                    }
                    a3_BagModel.getInstance().addItem(itemData);

                    if (off_line_exp.instance != null)
                    {
                        if (off_line_exp.instance.offline == true)
                        {
                            off_line_exp.instance.offline_item.Add(itemData);
                            if (off_line_exp.instance.fenjie.isOn == false)
                            {
                                flytxt.instance.fly(ContMgr.getCont("BagProxy_getequip") + a3_BagModel.getInstance().getItemXml(item["tpid"]).getString("item_name"));
                            }
                            else
                            {
                                flytxt.instance.fly(ContMgr.getCont("BagProxy_geteitem") + a3_BagModel.getInstance().getItemXml(item["tpid"]).getString("item_name") + "x" + (item["cnt"] - m));
                            }
                        }
                    }
                    if (A3_SummonProxy.getInstance().getNewSum)
                    {
                        A3_SummonProxy.getInstance().getNewSum = false;
                        //dispatchEvent(GameEvent.Create(EVENT_GET_SUM, this, item));
                        if (a3_summon_tujian.instans != null)
                        {
                            a3_summon_tujian.instans.ongetsum(itemData);
                        }
                    }

                    //添加魔晶
                    //if (itemData.tpid == 1540)
                    //{
                    //    if (a3_expbar.instance != null) a3_expbar.instance.CheckNewSkill();
                    //}
                }
                //if (off_line_exp.instance?.offline == true)
                //{
                //    if (off_line_exp.instance.offline_item != null)
                //    {
                //        foreach (var v in off_line_exp.instance.offline_item)
                //        {
                //            a3_ItemData item = a3_BagModel.getInstance().getItemDataById((uint)v.tpid);
                //            GameObject go = IconImageMgr.getInstance().createA3ItemIconTip(itemid: (uint)v.tpid, num: v.num);
                //            flytxt.instance.fly(null, 6, showIcon: go);
                //        }
                //    }
                //    off_line_exp.instance.offline = false;
                //    off_line_exp.instance.offline_item.Clear();
                //}

                if (a3_role.instan != null)
                {
                    dispatchEvent(GameEvent.Create(EVENT_USE_DYE, this, data));
                }
            }
            if (data.ContainsKey("modcnts"))
            {
                int     m    = 0;
                Variant info = data["modcnts"];
                foreach (Variant item in info._arr)
                {
                    a3_BagItemData itemData = new a3_BagItemData();
                    itemData.id   = item["id"];
                    itemData.tpid = item["tpid"];
                    itemData.num  = item["cnt"];
                    //itemData.bnd = item["bnd"];
                    itemData.isEquip = false;
                    itemData.isNew   = false;
                    if (a3_BagModel.getInstance().Items.ContainsKey(item["id"]))
                    {
                        m = a3_BagModel.getInstance().Items[item["id"]].num;
                    }
                    // Debug.LogError(a3_BagModel.getInstance().Items[item["id"]].num + "sss" + a3_BagModel.getInstance().getItemNumByTpid(1540)+"ss"+ a3_BagModel.getInstance().getItems()[item["id"]].num);


                    if (item.ContainsKey("intensify_lv"))
                    {
                        a3_EquipModel.getInstance().equipData_read(itemData, item);
                    }
                    int n = 0;
                    if (a3_BagModel.getInstance().getItems().ContainsKey(itemData.id))
                    {
                        n = a3_BagModel.getInstance().getItems()[itemData.id].num;
                    }
                    a3_BagModel.getInstance().addItem(itemData);
                    if (item["tpid"] == 1540)
                    {
                        skill_a3.upmojing = a3_BagModel.getInstance().getItemNumByTpid(1540);//魔晶剩余总量
                    }

                    if (off_line_exp.instance != null)
                    {
                        if (off_line_exp.instance.offline == true)
                        {
                            off_line_exp.instance.offline_item.Add(itemData);

                            flytxt.instance.fly(ContMgr.getCont("BagProxy_geteitem") + a3_BagModel.getInstance().getItemXml(item["tpid"]).getString("item_name") + "x" + (item["cnt"] - m));
                        }
                    }

                    //修改魔晶
                    //if (itemData.tpid == 1540 && n < itemData.num)
                    //{
                    //    if (a3_expbar.instance != null) a3_expbar.instance.CheckNewSkill();
                    //}
                }
            }
            if (data.ContainsKey("rmvids"))
            {
                //a3_BagModel.getInstance().addtype();
                Variant info = data["rmvids"];
                foreach (uint id in info._arr)
                {
                    a3_BagModel.getInstance().removeItem(id);
                }
            }

            if (data.ContainsKey("rmvids") || data.ContainsKey("add") || data.ContainsKey("modcnts"))
            {
                dispatchEvent(GameEvent.Create(EVENT_ITEM_CHANGE, this, data));
                //if (a3_bag.indtans) { a3_bag.indtans.onItemChange(data); }
                if (isRanse)
                {
                    dispatchEvent(GameEvent.Create(EVENT_USE_DYE, this, data));
                    isRanse = false;
                }
            }

            if (data.ContainsKey("nobpt"))
            {//声望点
                if ((data["nobpt"] > PlayerModel.getInstance().nobpt))
                {
                    flytxt.instance.fly(ContMgr.getCont("BagProxy_nobpt") + (data["nobpt"] - PlayerModel.getInstance().nobpt));
                }
                PlayerModel.getInstance().nobpt = data["nobpt"];
            }
            if (data.ContainsKey("energy"))
            {//体力
                MapModel.getInstance().energy = data["energy"];
                //if (fb_3d.instance != null)
                //    fb_3d.instance.refreshEnergy();

                //if (fb_energy.instance != null)
                //    fb_energy.instance.refresh();
            }
        }