Пример #1
0
        private void wannaGo(Variant data)
        {
            bool flag = data["line"] > 0;

            if (flag)
            {
                ModelBase <A3_dartModel> .getInstance().init(data["line"]);
            }
            bool flag2 = !this.isme;

            if (flag2)
            {
                flytxt.instance.fly("活动已开启", 0, default(Color), null);
                bool flag3 = GRMap.instance.m_nCurMapID >= 3333;
                if (!flag3)
                {
                    this.show2 = true;
                    InterfaceMgr.getInstance().open(InterfaceMgr.A3_LEGION_DART, null, false);
                    a3_legion_dart expr_97 = a3_legion_dart.instance;
                    if (expr_97 != null)
                    {
                        expr_97.getGameObjectByPath("candodart").SetActive(false);
                    }
                    a3_legion_dart expr_B3 = a3_legion_dart.instance;
                    if (expr_B3 != null)
                    {
                        expr_B3.getGameObjectByPath("cantdart").SetActive(true);
                    }
                }
            }
        }
Пример #2
0
        public override void init()
        {
            inText();
            instance = this;
            #region ====主界面初始化====
            ss      = XMLMgr.instance.GetSXML("clan_escort");
            listXml = ss.GetNodeList("line");
            length  = listXml.Count;


            for (int i = 0; i < length; i++)
            {
                clans cla = new clans();
                cla.open_lv_clan  = listXml[i].getInt("clan_lvl");
                cla.pathid        = listXml[i].getUint("id");
                cla.target_map    = listXml[i].getUint("target_map");
                cla.add_money_num = listXml[i].getInt("clan_money");
                cla.item_id       = listXml[i].getUint("item_id");
                cla.item_num      = listXml[i].getInt("item_num");
                if (!dicClan.ContainsKey(listXml[i].getInt("id")))
                {
                    dicClan.Add(listXml[i].getInt("id"), cla);
                }
            }
            one   = dicClan[1].open_lv_clan;
            three = dicClan[2].open_lv_clan;
            five  = dicClan[3].open_lv_clan;
            //Variant list = SvrMapConfig.instance.getSingleMapConf(dicClan[1].target_map);
            //getTransformByPath("candodart/scroll_view_dart/contain/UndergroundCity/bg/title").GetComponent<Text>().text = list["map_name"];
            //list = SvrMapConfig.instance.getSingleMapConf(dicClan[2].target_map);
            //getTransformByPath("candodart/scroll_view_dart/contain/darkPalace/bg/title").GetComponent<Text>().text = list["map_name"];
            //list = SvrMapConfig.instance.getSingleMapConf(dicClan[3].target_map);
            //getTransformByPath("candodart/scroll_view_dart/contain/coldWind/bg/title").GetComponent<Text>().text = list["map_name"];
            string      stri = "candodart/scroll_view_dart/contain";
            List <SXML> lisx = XMLMgr.instance.GetSXMLList("item.item", "id==" + dicClan[1].item_id);
            item_id = dicClan[1].item_id;
            getTransformByPath(stri + "/UndergroundCity/award/2/icon").GetComponent <Image>().sprite = GAMEAPI.ABUI_LoadSprite("icon_item_" + lisx[0].getInt("icon_file"));
            getTransformByPath(stri + "/UndergroundCity/award/1/icon").GetComponent <Image>().sprite = GAMEAPI.ABUI_LoadSprite("icon_comm_1x1");
            getTransformByPath(stri + "/UndergroundCity/award/1/Text").GetComponent <Text>().text    = dicClan[1].add_money_num.ToString();
            getTransformByPath(stri + "/UndergroundCity/award/2/Text").GetComponent <Text>().text    = dicClan[1].item_num.ToString();
            new BaseButton(getTransformByPath(stri + "/UndergroundCity/award/2")).onClick            = (GameObject go) =>
            {
                ArrayList arr = new ArrayList();
                arr.Add(dicClan[1].item_id);
                arr.Add(1);
                InterfaceMgr.getInstance().ui_async_open(InterfaceMgr.A3_MINITIP, arr);
            };
            lisx    = XMLMgr.instance.GetSXMLList("item.item", "id==" + dicClan[2].item_id);
            item_id = dicClan[2].item_id;
            getTransformByPath(stri + "/darkPalace/award/2/icon").GetComponent <Image>().sprite = GAMEAPI.ABUI_LoadSprite("icon_item_" + lisx[0].getInt("icon_file"));
            getTransformByPath(stri + "/darkPalace/award/1/icon").GetComponent <Image>().sprite = GAMEAPI.ABUI_LoadSprite("icon_comm_1x1");
            getTransformByPath(stri + "/darkPalace/award/1/Text").GetComponent <Text>().text    = dicClan[2].add_money_num.ToString();
            getTransformByPath(stri + "/darkPalace/award/2/Text").GetComponent <Text>().text    = dicClan[2].item_num.ToString();
            new BaseButton(getTransformByPath(stri + "/darkPalace/award/2")).onClick            = (GameObject go) =>
            {
                ArrayList arr = new ArrayList();
                arr.Add(dicClan[2].item_id);
                arr.Add(1);
                InterfaceMgr.getInstance().ui_async_open(InterfaceMgr.A3_MINITIP, arr);
            };
            lisx    = XMLMgr.instance.GetSXMLList("item.item", "id==" + dicClan[3].item_id);
            item_id = dicClan[3].item_id;
            getTransformByPath(stri + "/coldWind/award/2/icon").GetComponent <Image>().sprite = GAMEAPI.ABUI_LoadSprite("icon_item_" + lisx[0].getInt("icon_file"));
            getTransformByPath(stri + "/coldWind/award/1/icon").GetComponent <Image>().sprite = GAMEAPI.ABUI_LoadSprite("icon_comm_1x1");
            getTransformByPath(stri + "/coldWind/award/1/Text").GetComponent <Text>().text    = dicClan[3].add_money_num.ToString();
            getTransformByPath(stri + "/coldWind/award/2/Text").GetComponent <Text>().text    = dicClan[3].item_num.ToString();
            new BaseButton(getTransformByPath(stri + "/coldWind/award/2")).onClick            = (GameObject go) =>
            {
                ArrayList arr = new ArrayList();
                arr.Add(dicClan[3].item_id);
                arr.Add(1);
                InterfaceMgr.getInstance().ui_async_open(InterfaceMgr.A3_MINITIP, arr);
            };
            #endregion

            #region  ====button====
            new BaseButton(getTransformByPath("candodart/btn_close")).onClick = (GameObject go) =>
            {
                InterfaceMgr.getInstance().close(InterfaceMgr.A3_LEGION_DART);
            };
            new BaseButton(getTransformByPath("bg")).onClick = (GameObject go) =>
            {
                InterfaceMgr.getInstance().close(InterfaceMgr.A3_LEGION_DART);
            };
            new BaseButton(getTransformByPath("cantdart/close")).onClick = (GameObject go) =>
            {
                InterfaceMgr.getInstance().close(InterfaceMgr.A3_LEGION_DART);
            };
            new BaseButton(getTransformByPath("cantdart/bg/back")).onClick = (GameObject go) =>
            {
                InterfaceMgr.getInstance().close(InterfaceMgr.A3_LEGION_DART);
            };

            new BaseButton(getTransformByPath("cantdart/bg/go")).onClick = (GameObject go) =>
            {
                if ((int)PlayerModel.getInstance().mapid == 10)
                {
                    //SelfRole.moveToNPc(10, 1003);
                }
                else
                {
                    SelfRole.Transmit(10 * 100 + 1);
                }
                ltes = true;
                InterfaceMgr.getInstance().close(InterfaceMgr.A3_LEGION_DART);
            };

            new BaseButton(getTransformByPath("candodart/scroll_view_dart/contain/UndergroundCity/enter")).onClick = (GameObject go) =>
            {
                if (!a3_dartproxy.getInstance().canOpenDart)
                {
                    flytxt.instance.fly(ContMgr.getCont("clan_12")); return;
                }
                else
                {
                    if (A3_LegionModel.getInstance().myLegion.clanc < 3)  //领袖为4,元老为3
                    {
                        flytxt.instance.fly(ContMgr.getCont("clan_10"));
                        InterfaceMgr.getInstance().close(InterfaceMgr.A3_LEGION_DART);
                    }
                    else
                    {
                        a3_dartproxy.getInstance().sendDartStart(dicClan[1].pathid);
                        a3_dartproxy.getInstance().isme = true; ltes = true;  //ltes要改成服务器发送
                        InterfaceMgr.getInstance().close(InterfaceMgr.A3_LEGION_DART);
                    }
                }
            };
            new BaseButton(getTransformByPath("candodart/scroll_view_dart/contain/darkPalace/enter")).onClick = (GameObject go) =>
            {
                if (!a3_dartproxy.getInstance().canOpenDart)
                {
                    flytxt.instance.fly(ContMgr.getCont("clan_12")); return;
                }
                else
                {
                    if (A3_LegionModel.getInstance().myLegion.clanc < 3 || A3_LegionModel.getInstance().myLegion.lvl < three)//领袖为4,元老为3
                    {
                        flytxt.instance.fly(ContMgr.getCont("clan_10"));
                        InterfaceMgr.getInstance().close(InterfaceMgr.A3_LEGION_DART);
                    }
                    else if (A3_LegionModel.getInstance().myLegion.clanc >= 3 && A3_LegionModel.getInstance().myLegion.lvl >= three)
                    {
                        a3_dartproxy.getInstance().sendDartStart(dicClan[2].pathid);
                        a3_dartproxy.getInstance().isme = true; ltes = true;
                        InterfaceMgr.getInstance().close(InterfaceMgr.A3_LEGION_DART);
                    }
                }
            };
            new BaseButton(getTransformByPath("candodart/scroll_view_dart/contain/coldWind/enter")).onClick = (GameObject go) =>
            {
                if (!a3_dartproxy.getInstance().canOpenDart)
                {
                    flytxt.instance.fly(ContMgr.getCont("clan_12")); return;
                }
                else
                {
                    if (A3_LegionModel.getInstance().myLegion.clanc < 3 || A3_LegionModel.getInstance().myLegion.lvl < five)//领袖为4,元老为3
                    {
                        flytxt.instance.fly(ContMgr.getCont("clan_10"));
                        InterfaceMgr.getInstance().close(InterfaceMgr.A3_LEGION_DART);
                    }
                    else if (A3_LegionModel.getInstance().myLegion.clanc >= 3 && A3_LegionModel.getInstance().myLegion.lvl >= five)
                    {
                        a3_dartproxy.getInstance().sendDartStart(dicClan[3].pathid);
                        a3_dartproxy.getInstance().isme = true; ltes = true;
                        InterfaceMgr.getInstance().close(InterfaceMgr.A3_LEGION_DART);
                    }
                }
            };
            #endregion
            if (a3_dartproxy.getInstance().show2)
            {
                getGameObjectByPath("candodart").SetActive(false);
                getGameObjectByPath("cantdart").SetActive(true);
            }
            #region ====事件监听====
            A3_LegionProxy.getInstance().addEventListener(A3_LegionProxy.EVENT_CREATE, creatLegion);
            A3_LegionProxy.getInstance().addEventListener(A3_LegionProxy.EVENT_LVUP, upLegion);
            a3_dartproxy.getInstance().addEventListener(a3_dartproxy.EVENT_GETINFO, info);
            #endregion
        }