void init()
        {
            Transform showLayer = GameObject.Find("winLayer").transform;

            GameObject iconPrefab = GAMEAPI.ABLayer_LoadNow_GameObject("uilayer_msgbox");

            iconPrefab.transform.FindChild("Text").GetComponent <Text>().text     = ContMgr.getCont("msgbox_0");
            iconPrefab.transform.FindChild("yes/Text").GetComponent <Text>().text = ContMgr.getCont("ToSure_summon_1");
            iconPrefab.transform.FindChild("no/Text").GetComponent <Text>().text  = ContMgr.getCont("ToSure_summon_2");

            root = GameObject.Instantiate(iconPrefab) as GameObject;
            root.transform.SetParent(showLayer, false);
            text_str = root.transform.FindChild("Text").GetComponent <Text>();
            btn_yes  = root.transform.FindChild("yes").GetComponent <Button>();
            BaseButton bsYes = new BaseButton(btn_yes.transform);

            bsYes.onClick = null;
            btn_no        = root.transform.FindChild("no").GetComponent <Button>();
            BaseButton bsNo = new BaseButton(btn_no.transform);

            bsNo.onClick = null;

            btn_onekey = root.transform.FindChild("confirm").GetComponent <Button>();
            BaseButton bsOnekey = new BaseButton(btn_onekey.transform);


            bsOnekey.onClick = null;

            btn_yes.onClick.AddListener(onClick);
            btn_no.onClick.AddListener(hide);
            btn_onekey.onClick.AddListener(onClick);
            root.SetActive(false);
            //================
            GameObject dart_get_awd = GAMEAPI.ABLayer_LoadNow_GameObject("uilayer_msgbox_dart");

            dart_get_awd.transform.FindChild("str").GetComponent <Text>().text      = ContMgr.getCont("msgbox_dart_0");
            dart_get_awd.transform.FindChild("txt").GetComponent <Text>().text      = ContMgr.getCont("msgbox_dart_1");
            dart_get_awd.transform.FindChild("yes/Text").GetComponent <Text>().text = ContMgr.getCont("ToSure_summon_1");

            root_dart_awd = GameObject.Instantiate(dart_get_awd) as GameObject;
            root_dart_awd.transform.SetParent(showLayer, false);
            root_dart_awd.SetActive(false);
            text_dart = root_dart_awd.transform.FindChild("str").GetComponent <Text>();
            btn_dart  = root_dart_awd.transform.FindChild("yes").GetComponent <Button>();
            btn_dart.onClick.AddListener(onClick);
            //================
            GameObject task_fb_Prefab = GAMEAPI.ABLayer_LoadNow_GameObject("uilayer_msgbox_task_fb");

            task_fb_Prefab.transform.FindChild("confirm/Text").GetComponent <Text>().text = ContMgr.getCont("msgbox_task_fb_0");
            task_fb_Prefab.transform.FindChild("cancel/Text").GetComponent <Text>().text  = ContMgr.getCont("msgbox_task_fb_1");
            root_task_fb = GameObject.Instantiate(task_fb_Prefab) as GameObject;
            root_task_fb.transform.SetParent(showLayer, false);
            root_task_fb.SetActive(false);
            //================
            GameObject swtz_fb_Prefab = GAMEAPI.ABLayer_LoadNow_GameObject("uilayer_msgbox_swtz_fb");

            swtz_fb_Prefab.transform.FindChild("confirm/Text").GetComponent <Text>().text = ContMgr.getCont("msgbox_task_fb_0");
            swtz_fb_Prefab.transform.FindChild("Text").GetComponent <Text>().text         = ContMgr.getCont("msgbox_swtz_fb_0");
            swtz_fb_Prefab.transform.FindChild("cancel/Text").GetComponent <Text>().text  = ContMgr.getCont("msgbox_task_fb_1");
            swtz_fb_Prefab.transform.FindChild("tuijian").GetComponent <Text>().text      = ContMgr.getCont("msgbox_swtz_fb_1");
            root_swtz_fb = GameObject.Instantiate(swtz_fb_Prefab) as GameObject;
            root_swtz_fb.transform.SetParent(showLayer, false);
            root_swtz_fb.SetActive(false);
        }
Example #2
0
        public override void init()
        {
            instance           = this;
            item_Parent_fenjie = transform.FindChild("scroll_view/contain").GetComponent <GridLayoutGroup>();
            BaseButton btn_fenjieclose = new BaseButton(transform.FindChild("close"));

            btn_fenjieclose.onClick = onfenjieclose;

            BaseButton btn_fenjie = new BaseButton(transform.FindChild("info_bg/go"));

            btn_fenjie.onClick = Sendproxy;

            mojing          = getComponentByPath <Text>("info_bg/mojing/num");
            shengguanghuiji = getComponentByPath <Text>("info_bg/shenguang/num");
            mifageli        = getComponentByPath <Text>("info_bg/mifa/num");
            white           = getComponentByPath <Toggle>("info_bg/Toggle_all/Toggle_white");
            white.onValueChanged.AddListener(delegate(bool ison)
            {
                if (ison)
                {
                    EquipsSureSell(1); OnLoadItem_fenjie();
                }
                else
                {
                    outItemCon_fenjie(1); EquipsNoSell(1);
                }
            });

            green = getComponentByPath <Toggle>("info_bg/Toggle_all/Toggle_green");
            green.onValueChanged.AddListener(delegate(bool ison)
            {
                if (ison)
                {
                    EquipsSureSell(2); OnLoadItem_fenjie();
                    if (white.isOn == false)
                    {
                        white.isOn = true;
                    }
                }
                else
                {
                    outItemCon_fenjie(2); EquipsNoSell(2);
                }
            });
            blue = getComponentByPath <Toggle>("info_bg/Toggle_all/Toggle_blue");
            blue.onValueChanged.AddListener(delegate(bool ison)
            {
                if (ison)
                {
                    EquipsSureSell(3); OnLoadItem_fenjie();
                    if (green.isOn == false)
                    {
                        green.isOn = true;
                    }
                }
                else
                {
                    outItemCon_fenjie(3); EquipsNoSell(3);
                }
            });
            purple = getComponentByPath <Toggle>("info_bg/Toggle_all/Toggle_puple");
            purple.onValueChanged.AddListener(delegate(bool ison)
            {
                if (ison)
                {
                    EquipsSureSell(4); OnLoadItem_fenjie();
                    if (blue.isOn == false)
                    {
                        blue.isOn = true;
                    }
                }
                else
                {
                    outItemCon_fenjie(4); EquipsNoSell(4);
                }
            });
            orange = getComponentByPath <Toggle>("info_bg/Toggle_all/Toggle_orange");
            orange.onValueChanged.AddListener(delegate(bool ison)
            {
                if (ison)
                {
                    EquipsSureSell(5); OnLoadItem_fenjie();
                    if (purple.isOn == false)
                    {
                        purple.isOn = true;
                    }
                }
                else
                {
                    outItemCon_fenjie(5); EquipsNoSell(5);
                }
            });

            red = getComponentByPath <Toggle>("info_bg/Toggle_all/Toggle_red");
            red.onValueChanged.AddListener(delegate(bool ison)
            {
                if (ison)
                {
                    EquipsSureSell(6); OnLoadItem_fenjie();
                    if (orange.isOn == false)
                    {
                        orange.isOn = true;
                    }
                }
                else
                {
                    outItemCon_fenjie(6); EquipsNoSell(6);
                }
            });


            save = getComponentByPath <Toggle>("info_bg/Toggle_save");
            save.onValueChanged.AddListener(delegate(bool ison)
            {
                if (ison)
                {
                    if (dic_BagItem != null)
                    {
                        save_fenjie(); Save();
                        if (white.isOn)
                        {
                            jilu1.Add(1);
                        }
                        if (green.isOn)
                        {
                            jilu1.Add(2);
                        }
                        if (blue.isOn)
                        {
                            jilu1.Add(3);
                        }
                        if (purple.isOn)
                        {
                            jilu1.Add(4);
                        }
                        if (orange.isOn)
                        {
                            jilu1.Add(5);
                        }
                        if (red.isOn)
                        {
                            jilu1.Add(6);
                        }
                    }
                }
                else
                {
                    mojing_num          = 0;
                    shengguanghuiji_num = 0;
                    mifageli_num        = 0;
                    foreach (int t in jilu1)
                    {
                        if (t == 1)
                        {
                            white.isOn = true; EquipsSureSell(1); OnLoadItem_fenjie();
                        }
                        if (t == 2)
                        {
                            green.isOn = true; EquipsSureSell(2); OnLoadItem_fenjie();
                        }
                        if (t == 3)
                        {
                            blue.isOn = true; EquipsSureSell(3); OnLoadItem_fenjie();
                        }
                        if (t == 4)
                        {
                            purple.isOn = true; EquipsSureSell(4); OnLoadItem_fenjie();
                        }
                        if (t == 5)
                        {
                            orange.isOn = true; EquipsSureSell(5); OnLoadItem_fenjie();
                        }
                        if (t == 6)
                        {
                            red.isOn = true; EquipsSureSell(6); OnLoadItem_fenjie();
                        }
                    }
                    jilu1.Clear();
                    //    int a = orange.isOn == true ? 5 : purple.isOn == true ? 4 : blue.isOn == true ? 3 : green.isOn == true ? 2 : white.isOn == true ? 1 : 0;

                    //    switch (a)
                    //    {
                    //        case 5:
                    //            EquipsSureSell(5);
                    //            OnLoadItem_fenjie();
                    //            EquipsSureSell(4); OnLoadItem_fenjie();
                    //            EquipsSureSell(3); OnLoadItem_fenjie();
                    //            EquipsSureSell(2); OnLoadItem_fenjie();
                    //            EquipsSureSell(1); OnLoadItem_fenjie();
                    //            purple.isOn = true;
                    //            blue.isOn = true;
                    //            green.isOn = true;
                    //            white.isOn = true;
                    //            break;
                    //        case 4:
                    //            EquipsSureSell(4); OnLoadItem_fenjie();
                    //            EquipsSureSell(3); OnLoadItem_fenjie();
                    //            EquipsSureSell(2); OnLoadItem_fenjie();
                    //            EquipsSureSell(1); OnLoadItem_fenjie();
                    //            blue.isOn = true;
                    //            green.isOn = true;
                    //            white.isOn = true;
                    //            break;
                    //        case 3:
                    //            EquipsSureSell(3); OnLoadItem_fenjie();
                    //            EquipsSureSell(2); OnLoadItem_fenjie();
                    //            EquipsSureSell(1); OnLoadItem_fenjie();
                    //            green.isOn = true;
                    //            white.isOn = true;
                    //            break;
                    //        case 2:
                    //            EquipsSureSell(2); OnLoadItem_fenjie();
                    //            EquipsSureSell(1); OnLoadItem_fenjie();
                    //            white.isOn = true;
                    //            break;
                    //        default: EquipsSureSell(1); OnLoadItem_fenjie(); break;
                    //    }
                }
            });



            white.isOn  = false;
            green.isOn  = false;
            blue.isOn   = false;
            purple.isOn = false;
            orange.isOn = false;
            red.isOn    = false;
            save.isOn   = false;

            getComponentByPath <Text>("info_bg/go/Text").text = ContMgr.getCont("piliang_fenjie_1");
            getComponentByPath <Text>("info_bg/Toggle_all/Toggle_white/Label").text  = ContMgr.getCont("piliang_fenjie_2");
            getComponentByPath <Text>("info_bg/Toggle_all/Toggle_green/Label").text  = ContMgr.getCont("piliang_fenjie_3");
            getComponentByPath <Text>("info_bg/Toggle_all/Toggle_blue/Label").text   = ContMgr.getCont("piliang_fenjie_4");
            getComponentByPath <Text>("info_bg/Toggle_all/Toggle_puple/Label").text  = ContMgr.getCont("piliang_fenjie_5");
            getComponentByPath <Text>("info_bg/Toggle_all/Toggle_orange/Label").text = ContMgr.getCont("piliang_fenjie_6");
            getComponentByPath <Text>("info_bg/topText/Text").text      = ContMgr.getCont("piliang_fenjie_1");
            getComponentByPath <Text>("info_bg/ExplainTwo").text        = ContMgr.getCont("piliang_fenjie_7");
            getComponentByPath <Text>("info_bg/Toggle_save/Label").text = ContMgr.getCont("piliang_fenjie_8");
        }
        public override void init()
        {
            this.refreshExp();
            this.enterbtn  = new BaseButton(base.getTransformByPath("choiceDef/easy"), 1, 1);
            this.enterbtn1 = new BaseButton(base.getTransformByPath("choiceDef/normal"), 1, 1);
            this.enterbtn2 = new BaseButton(base.getTransformByPath("choiceDef/deffi"), 1, 1);
            this.enterbtn3 = new BaseButton(base.getTransformByPath("choiceDef/god"), 1, 1);
            this.pzhuan    = (int)ModelBase <PlayerModel> .getInstance().up_lvl;

            this.pji = (int)ModelBase <PlayerModel> .getInstance().lvl;

            this.changeSth();
            this.enterbtn.onClick = delegate(GameObject go)
            {
                base.gameObject.SetActive(false);
                bool flag = BaseProxy <TeamProxy> .getInstance().MyTeamData.itemTeamDataList.Count < 2;

                if (flag)
                {
                    Variant variant = new Variant();
                    variant["npcid"]    = 0;
                    variant["ltpid"]    = 109;
                    variant["diff_lvl"] = 1;
                    a3_counterpart.lvl  = variant["diff_lvl"];
                    BaseProxy <LevelProxy> .getInstance().sendCreate_lvl(variant);
                }
                else
                {
                    this.zhaunJi(1);
                    a3_counterpart_multi_gold.open = true;
                    bool flag2 = this.canINfb();
                    if (flag2)
                    {
                        BaseProxy <TeamProxy> .getInstance().SendReady(true, 109u, 1u);

                        a3_counterpart.instance.getTransformByPath("ready/yesorno/Text/name").GetComponent <Text>().text = "驯龙者的末日--简单";
                        a3_counterpart.instance.tenSen();
                        bool meIsCaptain = BaseProxy <TeamProxy> .getInstance().MyTeamData.meIsCaptain;

                        if (meIsCaptain)
                        {
                            a3_counterpart.instance.getTransformByPath("ready/yesorno/show/0/name").GetComponent <Text>().text = "自己";
                        }
                        a3_counterpart.instance.getGameObjectByPath("currentTeam").SetActive(true);
                        a3_counterpart.instance.getGameObjectByPath("ready").SetActive(true);
                        a3_counterpart.instance.getButtonByPath("ready/yesorno/yes").interactable = false;
                    }
                }
            };
            this.enterbtn1.onClick = delegate(GameObject go)
            {
                base.gameObject.SetActive(false);
                bool flag = BaseProxy <TeamProxy> .getInstance().MyTeamData.itemTeamDataList.Count < 2;

                if (flag)
                {
                    Variant variant = new Variant();
                    variant["npcid"]    = 0;
                    variant["ltpid"]    = 109;
                    variant["diff_lvl"] = 2;
                    a3_counterpart.lvl  = variant["diff_lvl"];
                    BaseProxy <LevelProxy> .getInstance().sendCreate_lvl(variant);
                }
                else
                {
                    this.zhaunJi(2);
                    a3_counterpart_multi_gold.open = true;
                    bool flag2 = this.canINfb();
                    if (flag2)
                    {
                        BaseProxy <TeamProxy> .getInstance().SendReady(true, 109u, 2u);

                        a3_counterpart.instance.getTransformByPath("ready/yesorno/Text/name").GetComponent <Text>().text = "驯龙者的末日--普通";
                        a3_counterpart.instance.tenSen();
                        bool meIsCaptain = BaseProxy <TeamProxy> .getInstance().MyTeamData.meIsCaptain;

                        if (meIsCaptain)
                        {
                            a3_counterpart.instance.getTransformByPath("ready/yesorno/show/0/name").GetComponent <Text>().text = "自己";
                        }
                        a3_counterpart.instance.getGameObjectByPath("currentTeam").SetActive(true);
                        a3_counterpart.instance.getGameObjectByPath("ready").SetActive(true);
                        a3_counterpart.instance.getButtonByPath("ready/yesorno/yes").interactable = false;
                    }
                }
            };
            this.enterbtn2.onClick = delegate(GameObject go)
            {
                base.gameObject.SetActive(false);
                bool flag = BaseProxy <TeamProxy> .getInstance().MyTeamData.itemTeamDataList.Count < 2;

                if (flag)
                {
                    Variant variant = new Variant();
                    variant["npcid"]    = 0;
                    variant["ltpid"]    = 109;
                    variant["diff_lvl"] = 3;
                    a3_counterpart.lvl  = variant["diff_lvl"];
                    BaseProxy <LevelProxy> .getInstance().sendCreate_lvl(variant);
                }
                else
                {
                    this.zhaunJi(3);
                    a3_counterpart_multi_gold.open = true;
                    bool flag2 = this.canINfb();
                    if (flag2)
                    {
                        BaseProxy <TeamProxy> .getInstance().SendReady(true, 109u, 3u);

                        a3_counterpart.instance.getTransformByPath("ready/yesorno/Text/name").GetComponent <Text>().text = "驯龙者的末日--困难";
                        a3_counterpart.instance.tenSen();
                        bool meIsCaptain = BaseProxy <TeamProxy> .getInstance().MyTeamData.meIsCaptain;

                        if (meIsCaptain)
                        {
                            a3_counterpart.instance.getTransformByPath("ready/yesorno/show/0/name").GetComponent <Text>().text = "自己";
                        }
                        a3_counterpart.instance.getGameObjectByPath("currentTeam").SetActive(true);
                        a3_counterpart.instance.getGameObjectByPath("ready").SetActive(true);
                        a3_counterpart.instance.getButtonByPath("ready/yesorno/yes").interactable = false;
                    }
                }
            };
            this.enterbtn3.onClick = delegate(GameObject go)
            {
                base.gameObject.SetActive(false);
                bool flag = BaseProxy <TeamProxy> .getInstance().MyTeamData.itemTeamDataList.Count < 2;

                if (flag)
                {
                    Variant variant = new Variant();
                    variant["npcid"]    = 0;
                    variant["ltpid"]    = 109;
                    variant["diff_lvl"] = 4;
                    a3_counterpart.lvl  = variant["diff_lvl"];
                    BaseProxy <LevelProxy> .getInstance().sendCreate_lvl(variant);
                }
                else
                {
                    this.zhaunJi(4);
                    a3_counterpart_multi_gold.open = true;
                    bool flag2 = this.canINfb();
                    if (flag2)
                    {
                        BaseProxy <TeamProxy> .getInstance().SendReady(true, 109u, 4u);

                        a3_counterpart.instance.getTransformByPath("ready/yesorno/Text/name").GetComponent <Text>().text = "驯龙者的末日--地狱";
                        a3_counterpart.instance.tenSen();
                        bool meIsCaptain = BaseProxy <TeamProxy> .getInstance().MyTeamData.meIsCaptain;

                        if (meIsCaptain)
                        {
                            a3_counterpart.instance.getTransformByPath("ready/yesorno/show/0/name").GetComponent <Text>().text = "自己";
                        }
                        a3_counterpart.instance.getGameObjectByPath("currentTeam").SetActive(true);
                        a3_counterpart.instance.getGameObjectByPath("ready").SetActive(true);
                        a3_counterpart.instance.getButtonByPath("ready/yesorno/yes").interactable = false;
                    }
                }
            };
        }
Example #4
0
        private void show_eqp()
        {
            bool flag = BaseProxy <OffLineExpProxy> .getInstance().eqp.Count <= 16;

            if (flag)
            {
                this.contain.GetComponent <GridLayoutGroup>().constraint      = GridLayoutGroup.Constraint.FixedColumnCount;
                this.contain.GetComponent <GridLayoutGroup>().constraintCount = 8;
            }
            else
            {
                this.contain.GetComponent <GridLayoutGroup>().constraint      = GridLayoutGroup.Constraint.FixedRowCount;
                this.contain.GetComponent <GridLayoutGroup>().constraintCount = 2;
            }
            using (List <a3_BagItemData> .Enumerator enumerator = BaseProxy <OffLineExpProxy> .getInstance().eqp.GetEnumerator())
            {
                while (enumerator.MoveNext())
                {
                    a3_BagItemData d          = enumerator.Current;
                    GameObject     gameObject = UnityEngine.Object.Instantiate <GameObject>(this.eqp_icon);
                    gameObject.SetActive(true);
                    gameObject.transform.SetParent(this.contain.transform, false);
                    gameObject.transform.FindChild("equp").GetComponent <Image>().sprite = (Resources.Load("icon/item/" + d.tpid, typeof(Sprite)) as Sprite);
                    Transform   arg_131_0 = gameObject.transform;
                    object      arg_12C_0 = "quality_bg/";
                    a3_ItemData confdata  = d.confdata;
                    arg_131_0.FindChild(arg_12C_0 + confdata.equip_level).gameObject.SetActive(true);
                    BaseButton baseButton = new BaseButton(gameObject.transform.FindChild("equp").transform, 1, 1);
                    baseButton.onClick = delegate(GameObject goo)
                    {
                        ArrayList      arrayList = new ArrayList();
                        a3_BagItemData d         = d;
                        arrayList.Add(d);
                        arrayList.Add(equip_tip_type.Comon_tip);
                        InterfaceMgr.getInstance().open(InterfaceMgr.A3_EQUIPTIP, arrayList, false);
                    };
                }
            }
            bool flag2 = BaseProxy <OffLineExpProxy> .getInstance().eqp.Count < 16;

            if (flag2)
            {
                for (int i = 0; i < 16 - BaseProxy <OffLineExpProxy> .getInstance().eqp.Count; i++)
                {
                    GameObject gameObject2 = UnityEngine.Object.Instantiate <GameObject>(this.eqp_icon);
                    gameObject2.SetActive(true);
                    gameObject2.transform.SetParent(this.contain.transform, false);
                    gameObject2.transform.FindChild("equp").gameObject.SetActive(false);
                }
            }
            else
            {
                bool flag3 = BaseProxy <OffLineExpProxy> .getInstance().eqp.Count % 2 != 0;

                if (flag3)
                {
                    GameObject gameObject3 = UnityEngine.Object.Instantiate <GameObject>(this.eqp_icon);
                    gameObject3.SetActive(true);
                    gameObject3.transform.SetParent(this.contain.transform, false);
                    gameObject3.transform.FindChild("equp").gameObject.SetActive(false);
                }
            }
            this.contain.GetComponent <RectTransform>().sizeDelta = new Vector2((this.eqp_icon.GetComponent <RectTransform>().sizeDelta.x + 2.5f) * (float)Mathf.CeilToInt((float)BaseProxy <OffLineExpProxy> .getInstance().eqp.Count / 2f), this.eqp_icon.GetComponent <RectTransform>().sizeDelta.x * 2f);
        }
Example #5
0
        public override void init()
        {
            #region 初始化汉字
            getComponentByPath <Text>("timeBuy/buyIt/Text").text = ContMgr.getCont("a3_new_pet_00");
            getComponentByPath <Text>("timeBuy/use/Text").text   = ContMgr.getCont("a3_new_pet_0000");
            getComponentByPath <Text>("help/descTxt").text       = ContMgr.getCont("a3_new_pet_11") + "\n" + ContMgr.getCont("a3_new_pet_1212") + "\n" + ContMgr.getCont("a3_new_pet_1313") + "\n" + ContMgr.getCont("a3_new_pet_1414");
            getComponentByPath <Text>("help/btn/Text").text      = ContMgr.getCont("a3_new_pet_22");
            getComponentByPath <Text>("buyshow/scollBuy/content/buy0/free").text      = ContMgr.getCont("a3_new_pet_33");
            getComponentByPath <Text>("buyshow/scollBuy/content/buy0/image/buy").text = ContMgr.getCont("a3_new_pet_44");
            getComponentByPath <Text>("buyshow/scollBuy/content/buy1/1").text         = ContMgr.getCont("a3_new_pet_55");
            getComponentByPath <Text>("buyshow/scollBuy/content/buy1/image/buy").text = ContMgr.getCont("a3_new_pet_66");
            getComponentByPath <Text>("buyshow/scollBuy/content/buy2/3").text         = ContMgr.getCont("a3_new_pet_77");
            getComponentByPath <Text>("buyshow/scollBuy/content/buy2/image/buy").text = ContMgr.getCont("a3_new_pet_88");
            getComponentByPath <Text>("zdsq/info").text  = ContMgr.getCont("a3_new_pet_99");
            getComponentByPath <Text>("lxjy/info").text  = ContMgr.getCont("a3_new_pet_1010");
            getComponentByPath <Text>("lxjy/info2").text = ContMgr.getCont("a3_new_pet_1111");


            getComponentByPath <Text>("buyshow/scollBuy/content/buy3/image/buy").text = ContMgr.getCont("a3_new_pet_89");
            #endregion



            instance   = this;
            pet_name   = getComponentByPath <Text>("pet_name/Text");
            usepet_btn = getGameObjectByPath("timeBuy/use");
            zdsq       = getGameObjectByPath("zdsq");
            lxjy       = getGameObjectByPath("lxjy");
            new BaseButton(getTransformByPath("btn_zdsq")).onClick = (GameObject go) => { zdsq.SetActive(true); };
            new BaseButton(getTransformByPath("btn_lxjy")).onClick = (GameObject go) => { lxjy.SetActive(true); };
            BaseButton lxjyclose  = new BaseButton(getTransformByPath("lxjy/close"));
            BaseButton lxjyclose1 = new BaseButton(getTransformByPath("lxjy/close1"));
            lxjyclose.onClick = lxjyclose1.onClick = (GameObject go) => { lxjy.SetActive(false); };
            BaseButton zdsqclose  = new BaseButton(getTransformByPath("zdsq/close"));
            BaseButton zdsqclose1 = new BaseButton(getTransformByPath("zdsq/close1"));
            zdsqclose.onClick = zdsqclose1.onClick = (GameObject go) => { zdsq.SetActive(false); };
            //if (PlayerModel.getInstance().last_time == -1)
            //{
            //    lastTime = -1;
            //    getGameObjectByPath("timeBuy/buyIt").SetActive(false);
            //}
            if (PlayerModel.getInstance().last_time <= 0)
            {
                lastTime = 0;
                usepet_btn.SetActive(false);
            }
            else if (PlayerModel.getInstance().last_time > 0)
            {
                usepet_btn.SetActive(true);
                lastTime = PlayerModel.getInstance().last_time - muNetCleint.instance.CurServerTimeStamp;//当前饲料剩余时间
            }

            first = PlayerModel.getInstance().first;
            debug.Log("first:" + first.ToString() + "  last_time:" + lastTime);
            petgo    = new petGO();
            timeGo   = transform.FindChild("timeBuy/Text").GetComponent <Text>();
            sliderGo = getGameObjectByPath("timeBuy/expbar/slider");
            if (first)
            {
                getGameObjectByPath("buyshow/scollBuy/content/buy0").SetActive(true);
            }
            else
            {
                getGameObjectByPath("buyshow/scollBuy/content/buy0").SetActive(false);
            }

            //A3_PetProxy.getInstance().addEventListener(A3_PetProxy.EVENT_GET_LAST_TIME, getlastTime);
            A3_PetProxy.getInstance().addEventListener(A3_PetProxy.EVENT_GET_PET, getPet);
            //A3_PetProxy.getInstance().addEventListener(A3_PetProxy.EVENT_SHOW_PET, showPet);
            //A3_PetProxy.getInstance().addEventListener(A3_PetProxy.EVENT_FEED_PET, feedPet);
            //A3_PetProxy.getInstance().addEventListener(A3_PetProxy.EVENT_HAVE_PET, havePet);
            //if (lastTime <= -1)
            //{
            //    lastTime = -1;
            //    getGameObjectByPath("timeBuy/buyIt").SetActive(false);
            //}

            #region button
            new BaseButton(getTransformByPath("title/btn_close")).onClick = (GameObject go) =>
            {
                InterfaceMgr.getInstance().close(InterfaceMgr.A3_NEW_PET);
            };
            BaseButton touchClose = new BaseButton(getTransformByPath("buyshow/touchClose"));
            touchClose.onClick = close;
            new BaseButton(getTransformByPath("showSth/help")).onClick = (GameObject go) =>
            {
                getGameObjectByPath("help").SetActive(true);
            };
            new BaseButton(getTransformByPath("help/btn")).onClick = (GameObject go) =>
            {
                getGameObjectByPath("help").SetActive(false);
            };
            //金币钻石绑钻按钮
            new BaseButton(getTransformByPath("top/jingbi/Image")).onClick = (GameObject go) =>
            {
                InterfaceMgr.getInstance().ui_async_open(InterfaceMgr.A3_EXCHANGE);
                if (a3_exchange.Instance != null)
                {
                    a3_exchange.Instance.transform.SetAsLastSibling();
                }
            };
            new BaseButton(getTransformByPath("top/zuanshi/Image")).onClick = (GameObject go) =>
            {
                toback = true;
                InterfaceMgr.getInstance().close(this.uiName);
                InterfaceMgr.getInstance().ui_async_open(InterfaceMgr.A3_RECHARGE);
            };
            new BaseButton(getTransformByPath("top/bangzuan/Image")).onClick = (GameObject go) =>
            {
                InterfaceMgr.getInstance().ui_async_open(InterfaceMgr.A3_HONOR);
                if (a3_honor.instan != null)
                {
                    a3_honor.instan.transform.SetAsLastSibling();
                }
            };
            //===============
            //购买饲料
            new BaseButton(getTransformByPath("timeBuy/buyIt")).onClick = (GameObject go) =>
            {
                //if (all <= -1)
                //{
                //    flytxt.instance.fly(ContMgr.getCont("a3_new_pet_long"));
                //}
                //else
                getGameObjectByPath("buyshow").SetActive(true);
            };
            //免费一天-----1\2\永久
            new BaseButton(getTransformByPath("buyshow/scollBuy/content/buy0/image")).onClick = (GameObject go) =>
            {
                A3_PetProxy.getInstance().SendTime(1);
                getGameObjectByPath("buyshow").SetActive(false);
                getGameObjectByPath("buyshow/scollBuy/content/buy0").SetActive(false);
            };
            new BaseButton(getTransformByPath("buyshow/scollBuy/content/buy1/image")).onClick = (GameObject go) =>
            {
                A3_PetProxy.getInstance().SendTime(2);
                getGameObjectByPath("buyshow").SetActive(false);
            };
            new BaseButton(getTransformByPath("buyshow/scollBuy/content/buy2/image")).onClick = (GameObject go) =>
            {
                A3_PetProxy.getInstance().SendTime(3);
                getGameObjectByPath("buyshow").SetActive(false);
            };
            new BaseButton(getTransformByPath("buyshow/scollBuy/content/buy3/image")).onClick = (GameObject go) =>
            {
                getGameObjectByPath("buyshow").SetActive(false);
                A3_PetProxy.getInstance().SendTime(4);
                List <SXML> buyList = XMLMgr.instance.GetSXMLList("newpet.buy.b", "id==" + 4);
                int         zuan    = buyList[0].getInt("zuan");
                //if (zuan <= PlayerModel.getInstance().gold)
                //    getGameObjectByPath("timeBuy/buyIt").SetActive(false);
            };
            //===============
            #endregion
            iconTemp = getGameObjectByPath("icon_temp");
            xml      = XMLMgr.instance.GetSXML("newpet");
            list     = xml.GetNodeList("pet");
            petNum   = list.Count;
            cont     = getTransformByPath("scoll/cont");
            sizeY    = cont.GetComponent <GridLayoutGroup>().cellSize.y;
            cont.GetComponent <RectTransform>().sizeDelta = new Vector2(130f, sizeY * petNum);
            transform.FindChild("ig_bg_bg").gameObject.SetActive(false);

            getEventTrigerByPath("rotate").onDrag = OnDrag;

            #region 宠物icon按钮
            A3_PetModel petmodel = A3_PetModel.getInstance();
            getTransformByPath("shuxing/exp/Text").GetComponent <Text>().text   = ContMgr.getCont("a3_new_pet_1") + list[0].getInt("exp") + "%";
            getTransformByPath("shuxing/gold/Text").GetComponent <Text>().text  = ContMgr.getCont("a3_new_pet_2") + list[0].getInt("gold") + "%";
            getTransformByPath("shuxing/equip/Text").GetComponent <Text>().text = ContMgr.getCont("a3_new_pet_3") + list[0].getInt("arm") + "%";
            getTransformByPath("shuxing/mate/Text").GetComponent <Text>().text  = ContMgr.getCont("a3_new_pet_4") + list[0].getInt("mat") + "%";

            foreach (var item in list)
            {
                goIcon = Instantiate(iconTemp) as GameObject;
                goIcon.transform.SetParent(getTransformByPath("scoll/cont"));
                goIcon.name = item.getString("pet_id");
                goIcon.SetActive(true);
                goIcon.transform.localScale = Vector3.one;
                String str = "scoll/cont/" + goIcon.name + "/icon_bg/icon";
                transform.FindChild("scoll/cont/" + list[0].getString("pet_id") + "/icon_bg/image_on").gameObject.SetActive(true);
                string names = item.getString("mod");
                // if (names == "jiexi")
                //  names = "yingwu";
                getTransformByPath(str).GetComponent <Image>().sprite = GAMEAPI.ABUI_LoadSprite("icon_pet_" + names);
                new BaseButton(transform.FindChild("scoll/cont/" + goIcon.name + "/icon_bg/icon")).onClick = (GameObject go) =>
                {
                    chosenpetBtnOnClick(go, false);
                };
                new BaseButton(transform.FindChild("scoll/cont/" + goIcon.name + "/lock")).onClick = (GameObject go) =>
                {
                    chosenpetBtnOnClick(go, true);
                };
            }
            timeSet(lastTime);
            CancelInvoke("time");
            InvokeRepeating("time", 0, 1);
            if (A3_PetModel.curPetid != 0)
            {
                transform.FindChild("scoll/cont/" + A3_PetModel.curPetid + "/icon_bg/yuxuan_on").gameObject.SetActive(true);
            }
            #endregion
            getPet0();
            if (a3_everydayLogin.instans != null && a3_everydayLogin.instans.open)
            {
                InterfaceMgr.getInstance().close(InterfaceMgr.A3_EVERYDAYLOGIN);
                openEveryLogin = true;
            }

            new BaseButton(usepet_btn.transform).onClick = (GameObject go) =>
            {
                if (A3_PetModel.curPetid == old_petid)
                {
                    flytxt.instance.fly(ContMgr.getCont("pet_this_old"));
                    return;
                }
                for (int i = 0; i < getTransformByPath("scoll/cont").childCount; i++)
                {
                    if (int.Parse(getTransformByPath("scoll/cont").GetChild(i).gameObject.name) == petid)
                    {
                        getTransformByPath("scoll/cont").GetChild(i).FindChild("icon_bg/yuxuan_on").gameObject.SetActive(true);
                    }
                    else
                    {
                        getTransformByPath("scoll/cont").GetChild(i).FindChild("icon_bg/yuxuan_on").gameObject.SetActive(false);
                    }
                }
                A3_PetProxy.getInstance().SendPetId(petid);    //发送换宠物
            };
        }
Example #6
0
        public override void init()
        {
            base.init();
            instance    = this;
            contain     = getGameObjectByPath("equp/scroll/contain").transform;
            eqp_icon    = getGameObjectByPath("icon");
            left_click  = new BaseButton(transform.FindChild("r_l_btn/left"));
            right_click = new BaseButton(transform.FindChild("r_l_btn/right"));//getGameObjectByPath("r_l_btn/right").GetComponent<BaseButton>();

            Text_exp = transform.FindChild("exp_bg/exp").gameObject.GetComponent <Text>();
            fenjie   = getComponentByPath <Toggle>("Toggle_fenjie");
            //fenjie.onValueChanged.AddListener(delegate (bool ison)
            //{
            //    if (ison) { EquipsSureSell();/* OnLoadItem_fenjie();*/ }
            //    else { outItemCon_fenjie(); /*EquipsNoSell(1);*/ }
            //});


            btn1      = new BaseButton(transform.FindChild("exp/btn1/btn"));
            btn2      = new BaseButton(transform.FindChild("exp/btn2/btn"));
            btn3      = new BaseButton(transform.FindChild("exp/btn3/btn"));
            btn4      = new BaseButton(transform.FindChild("exp/btn4/btn"));
            closeBtn1 = new BaseButton(transform.FindChild("closeBtn"));

            Text_time = this.getComponentByPath <Text>("state/Text_time");
            //timeSlider = this.getComponentByPath<Slider>("state/time_Slider");
            timeSlider            = transform.FindChild("state/time_Slider/Fill Area/Fill").GetComponent <Image>();
            timeSlider.type       = Image.Type.Filled;
            timeSlider.fillMethod = Image.FillMethod.Vertical;
            timeSlider.fillOrigin = (int)Image.OriginVertical.Bottom;

            vip_getexp_btn();
            btn1.onClick        = delegate(GameObject go) { OnClickToGetExp(1); };
            btn2.onClick        = delegate(GameObject go) { OnClickToGetExp(2); };
            btn3.onClick        = delegate(GameObject go) { OnClickToGetExp(3); };
            btn4.onClick        = delegate(GameObject go) { OnClickToGetExp(4); };
            left_click.onClick  = delegate(GameObject go) { OnClick_left(); };
            right_click.onClick = delegate(GameObject go) { OnClick_right(); };
            closeBtn1.onClick   = delegate(GameObject go) { OnClickToClose(); };
            recharge            = transform.FindChild("recharge").gameObject;
            lBtn.Add(btn1);
            lBtn.Add(btn2);
            lBtn.Add(btn3);
            lBtn.Add(btn4);
            lBtn2.Add(closeBtn1);
            lBtn2.Add(left_click);
            lBtn2.Add(right_click);
            offLineModel = OffLineModel.getInstance();

            //btn3.transform.FindChild("Text").GetComponent<Text>().text = "VIP" + vip_lite(3) + "领取";
            //btn4.transform.FindChild("Text").GetComponent<Text>().text = "VIP" + vip_lite(4) + "领取";
            //if (PlayerModel.getInstance().last_time == 0)
            //{
            //    transform.FindChild("equp/image_con").gameObject.SetActive(true);
            //}
            //Debug.LogError(PlayerModel.getInstance().havePet + "sss" + PlayerModel.getInstance().last_time);
            //OffLineExpProxy.getInstance().Send_Off_Line(0);
            //OffLineExpProxy.getInstance().sendType(0);

            #region 初始化汉字提取
            getComponentByPath <Text>("exp/btn1/Text").text         = ContMgr.getCont("off_line_exp_0");
            getComponentByPath <Text>("exp/btn2/btn/TextOnee").text = ContMgr.getCont("off_line_exp_1");
            getComponentByPath <Text>("state/Text_des").text        = ContMgr.getCont("off_line_exp_2");
            getComponentByPath <Text>("state/Text_desc_1").text     = ContMgr.getCont("off_line_exp_3");
            getComponentByPath <Text>("exp_bg/text").text           = ContMgr.getCont("off_line_exp_4");
            getComponentByPath <Text>("recharge/Text").text         = ContMgr.getCont("off_line_exp_5");
            getComponentByPath <Text>("recharge/yes/Text").text     = ContMgr.getCont("off_line_exp_6");
            getComponentByPath <Text>("Toggle_fenjie/Label").text   = ContMgr.getCont("piliang_fenjie_0");
            getComponentByPath <Text>("equp/image_con/text").text   = ContMgr.getCont("off_line_exp_7");
            getComponentByPath <Text>("btn/btn1/text").text         = ContMgr.getCont("off_line_exp_8");
            getComponentByPath <Text>("btn/btn2/text").text         = ContMgr.getCont("off_line_exp_9");

            getComponentByPath <Text>("exp/btn1/btn/Text").text        = ContMgr.getCont("off_line_exp_1");
            getComponentByPath <Text>("exp/btn3/btn/image1/Text").text = ContMgr.getCont("off_line_exp_1");
            getComponentByPath <Text>("exp/btn4/btn/image1/Text").text = ContMgr.getCont("off_line_exp_1");

            #endregion
        }
Example #7
0
        public override void init()
        {
            scrollControer0 = new ScrollControler();
            scrollControer0.create(getComponentByPath <ScrollRect>("att"));

            wingModel = A3_WingModel.getInstance();
            wingXML   = wingModel.WingXML;

            textName  = this.getComponentByPath <Text>("Text_name");
            textLevel = this.getComponentByPath <Text>("Text_name/lvl");
            textStage = this.getComponentByPath <Text>("Text_name/stage");

            btnHelp         = new BaseButton(this.getTransformByPath("title/help"));
            btnHelp.onClick = OnOpenHelp;

            tempPgaeAtt = this.getGameObjectByPath("att_temp");
            conAtt      = this.getTransformByPath("att/grid");

            conLevelTable           = this.getTransformByPath("con_level");
            textSliderState         = this.getComponentByPath <Text>("con_level/expbar/text");
            btnLevelUpgrade         = new BaseButton(this.getTransformByPath("con_level/upgrade"));
            btnLevelUpgrade.onClick = OnUpgradeClick;
            btnLevelOneKey          = new BaseButton(this.getTransformByPath("con_level/onekey"));
            btnLevelOneKey.onClick  = OnUpgradeOneKey;
            conStar      = this.getTransformByPath("con_level/con_star");
            sliderExpBar = this.getComponentByPath <Slider>("con_level/expbar/slider");

            conCompleteTable = this.getTransformByPath("con_complete");


            conIcon              = this.getTransformByPath("panel_icon/mask/scroll_rect/con_icon");
            iconTemp             = this.getGameObjectByPath("panel_icon/icon_temp");
            btnTurnLeft          = new BaseButton(this.getTransformByPath("panel_icon/btn_left"));
            btnTurnLeft.onClick  = OnTurnLeftClick;
            btnTurnRight         = new BaseButton(this.getTransformByPath("panel_icon/btn_right"));
            btnTurnRight.onClick = OnTurnRightClick;

            BaseButton close_btn = new BaseButton(this.getTransformByPath("btn_close"));

            close_btn.onClick = onClose;

            textLevelCostItemSum = this.getComponentByPath <Text>("con_level/upgrade/text");

            conStageTable        = this.getTransformByPath("con_stage");
            textStageRate        = this.getComponentByPath <Text>("con_stage/rate");
            textStageCostItemSum = this.getComponentByPath <Text>("con_stage/improve/text");
            btnStageUp           = new BaseButton(this.getTransformByPath("con_stage/improve"));
            btnStageUp.onClick   = OnStageUpClick;
            sliderStage          = this.getComponentByPath <Slider>("con_stage/slider");
            sliderStage.onValueChanged.AddListener(OnSliderValueChange);
            sliderStage.value = 1;

            conHelpPanel         = this.getTransformByPath("panel_help");
            btnCloseHelp         = new BaseButton(this.getTransformByPath("panel_help/closeBtn"));
            btnCloseHelp.onClick = OnCloseHelp;

            aniExp     = conLevelTable.GetComponent <Animator>();
            aniLevelUp = this.getGameObjectByPath("ani_lvlUP");
            process    = new processStruct(Update_wing, "a3_wing_skin");

            this.getEventTrigerByPath("panel_icon").onDrag = onDragIcon;

            aniStarTrans = this.getTransformByPath("con_level/con_star/ani_star");
            conStarPoint = this.getTransformByPath("con_level/point");

            this.getEventTrigerByPath("con_avatar/avatar_touch").onDrag = OnDrag;

            BaseButton btnWing = new BaseButton(this.getTransformByPath("btnWing"));

            btnWing.onClick = OnEquWing;

            success = this.transform.FindChild("ani_success").GetComponent <Animator>();
            fail    = this.transform.FindChild("ani_fail").GetComponent <Animator>();


            needobjid_stage = XMLMgr.instance.GetSXML("wings.stage_item").getInt("item_id");
            needobj_id      = XMLMgr.instance.GetSXML("wings.level_item").getInt("item_id");

            #region 初始化汉字
            getComponentByPath <Text>("title/Text").text               = ContMgr.getCont("a3_wing_skin_0");
            getComponentByPath <Text>("att_temp/text_name").text       = ContMgr.getCont("a3_wing_skin_1");
            getComponentByPath <Text>("con_level/upgrade/Text").text   = ContMgr.getCont("a3_wing_skin_2");
            getComponentByPath <Text>("con_level/onekey/Text").text    = ContMgr.getCont("a3_wing_skin_3");
            getComponentByPath <Text>("con_level/shengyu").text        = ContMgr.getCont("a3_wing_skin_4");
            getComponentByPath <Text>("con_stage/Text").text           = ContMgr.getCont("a3_wing_skin_5");
            getComponentByPath <Text>("con_stage/shengyu").text        = ContMgr.getCont("a3_wing_skin_4");
            getComponentByPath <Text>("con_complete/title/text").text  = ContMgr.getCont("a3_wing_skin_6");
            getComponentByPath <Text>("btn_equip/Text").text           = ContMgr.getCont("a3_wing_skin_7");
            getComponentByPath <Text>("panel_icon/icon_temp/lvl").text = ContMgr.getCont("a3_wing_skin_8");
            getComponentByPath <Text>("btnWing/Text").text             = ContMgr.getCont("a3_wing_skin_9");
            getComponentByPath <Text>("panel_help/descTxt").text       = ContMgr.getCont("a3_wing_skin_10");
            getComponentByPath <Text>("panel_help/closeBtn/Text").text = ContMgr.getCont("a3_wing_skin_11");
            #endregion
        }
Example #8
0
        override public void init()
        {
            #region --右侧功能区初始化
            _petListCon    = transform.FindChild("petListCon");
            _petTrainCon   = transform.FindChild("petTrainCon");
            _petUpgradeCon = transform.FindChild("petUpgradeCon");
            #endregion

            #region --左侧列表初始化

            _petListBtn = transform.FindChild("leftList/scroll_view/container/petListBtn");
            BaseButton b_petListBtn = new BaseButton(_petListBtn, 0, 0);
            b_petListBtn.onClick = OnClickPetListBtn;

            _petTrainBtn = transform.FindChild("leftList/scroll_view/container/petTrainBtn");
            BaseButton b_petTrainBtn = new BaseButton(_petTrainBtn, 0, 0);
            b_petTrainBtn.onClick = OnClickPetTrainBtn;

            _petUpgradeBtn = transform.FindChild("leftList/scroll_view/container/petUpgradeBtn");
            BaseButton b_petUpgradeBtn = new BaseButton(_petUpgradeBtn, 0, 0);
            b_petUpgradeBtn.onClick = OnClickPetUpgradeBtn;

            #endregion

            #region --中间宠物展示初始化
            _petShowPrefab            = Resources.Load("prefab/pet_show") as GameObject;
            _petShowGrid              = transform.FindChild("petList/scroll_view/grid").GetComponent <GridLayoutGroup>();
            _petShowContentSizeFitter = _petShowGrid.GetComponent <ContentSizeFitter>();
            #endregion

            #region --宠物列表Container初始化
            _petListNameTxt  = transform.FindChild("petListCon/nametxt").GetComponent <Text>();
            _petListLevelTxt = transform.FindChild("petListCon/leveltxt").GetComponent <Text>();
            _hungrySlider    = transform.FindChild("petListCon/hungrySlider").GetComponent <Slider>();
            _hungrySliderTxt = transform.FindChild("petListCon/hungrySlider/hungryValTxt").GetComponent <Text>();
            _expSlider       = transform.FindChild("petListCon/expSlider").GetComponent <Slider>();
            _expSliderTxt    = transform.FindChild("petListCon/expSlider/expValTxt").GetComponent <Text>();
            _petListAtt      = transform.FindChild("petListCon/pet_att/petatts").gameObject;
            _hungryAutoUse   = transform.FindChild("petListCon/hungryAutoUse").GetComponent <Toggle>();
            _feedBtn         = transform.FindChild("petListCon/feedBtn").GetComponent <Button>();
            _recyleBtn       = transform.FindChild("petListCon/recyleBtn").GetComponent <Button>();
            _changeNameBtn   = transform.FindChild("petListCon/changeNameBtn").GetComponent <Button>();
            _useBtn          = transform.FindChild("petListCon/useBtn").GetComponent <Button>();
            #endregion

            #region --宠物培养Container初始化
            _petTrainNameTxt  = transform.FindChild("petTrainCon/nametxt").GetComponent <Text>();
            _petTrainLevelTxt = transform.FindChild("petTrainCon/leveltxt").GetComponent <Text>();
            _petTrainAtt      = transform.FindChild("petTrainCon/pet_att/petatts").gameObject;
            _blessSlider      = transform.FindChild("petTrainCon/blessBar").GetComponent <Slider>();
            _blessSliderTxt   = transform.FindChild("petTrainCon/blessBar/blessVal").GetComponent <Text>();
            _costGoldTxt      = transform.FindChild("petTrainCon/costGoldVal").GetComponent <Text>();
            _costBlessTxt     = transform.FindChild("petTrainCon/costBlessVal").GetComponent <Text>();
            _blessLeftTxt     = transform.FindChild("petTrainCon/blessLeftVal").GetComponent <Text>();
            _diamondAutoUse   = transform.FindChild("petTrainCon/diamondAutoUse").GetComponent <Toggle>();
            _blessBtn         = transform.FindChild("petTrainCon/blessBtn").GetComponent <Button>();
            #endregion

            #region --宠物进阶Container初始化
            _pet3DShowImg      = transform.FindChild("petUpgradeCon/showbg").gameObject;
            _pet3DShowPoint    = transform.FindChild("petUpgradeCon/showbg/showPoint").gameObject;
            _petUpgrdeSuccTxt  = transform.FindChild("petUpgradeCon/showbg/upgradeRateBg/successRate").GetComponent <Text>();
            _peticon           = transform.FindChild("petUpgradeCon/petbg/peticon").GetComponent <Image>();
            _crystalSlider     = transform.FindChild("petUpgradeCon/crystalSlider").GetComponent <Slider>();
            _petUpgradeGlodTxt = transform.FindChild("petUpgradeCon/gldval").GetComponent <Text>();
            _crystalCostTxt    = transform.FindChild("petUpgradeCon/crystalVal").GetComponent <Text>();
            _crystalLeftTxt    = transform.FindChild("petUpgradeCon/crystalLeftBg/crystalLeftVal").GetComponent <Text>();
            _upgradeBtn        = transform.FindChild("petUpgradeCon/upgradeBtn").GetComponent <Text>();

            EventTriggerListener.Get(_pet3DShowImg).onDrag = OnDragPet3D;
            #endregion

            //!--关闭按钮
            _closeBtn = transform.FindChild("closeBtn");
            BaseButton b_closeBtn = new BaseButton(_closeBtn, 0, 0);
            b_closeBtn.onClick = OnClose;

            //TODO 测试用代码
            PetModel.getInstance().DummyData();
        }
Example #9
0
        private void RefreshMailContent(int id)//更新邮件的信息
        {
            mailtitle.gameObject.SetActive(false);
            mailcontent.gameObject.SetActive(false);
            fajianren2.gameObject.SetActive(false);
            time2.gameObject.SetActive(false);
            hint.gameObject.SetActive(false);
            del1.gameObject.SetActive(false);
            get.gameObject.SetActive(false);
            del2.gameObject.SetActive(false);
            tx_infos.gameObject.SetActive(false);
            for (int i = 0; i < itmGrid.transform.childCount; i++)
            {
                Destroy(itmGrid.transform.GetChild(i).gameObject);
            }
            for (int i = 0; i < coinGrid.transform.childCount; i++)//创造网格
            {
                Destroy(coinGrid.transform.GetChild(i).gameObject);
            }

            if (A3_MailModel.getInstance().mail_simple.Count == 0)
            {
                hint.gameObject.SetActive(true);
                hint.text = ContMgr.getCont("mail_hint_1");
                return;
            }

            if (id == -1 || !A3_MailModel.getInstance().mail_details.ContainsKey((uint)id))
            {//未选中邮件或邮件数据不存在
                hint.gameObject.SetActive(true);
                hint.text = ContMgr.getCont("mail_hint_2");
            }
            else
            {
                A3_MailDetail mdetail = A3_MailModel.getInstance().mail_details[(uint)id];

                mailtitle.gameObject.SetActive(true);
                mailtitle.text = mdetail.ms.title;

                fajianren2.gameObject.SetActive(true);
                fajianren2.text = mdetail.ms.tp;

                time2.gameObject.SetActive(true);
                string ts = MuGame.Globle.getStrTime((int)mdetail.ms.tm);
                time2.text = ts;

                mailcontent.gameObject.SetActive(true);
                mailcontent.text = mdetail.msg;

                if (!mdetail.ms.has_itm)
                {//!--没有附件
                    del2.gameObject.SetActive(true);
                }
                else
                {//!--有附件
                    GameObject icon;
                    if (mdetail.money != 0)
                    {
                        CreateCoinIcon("coin1", mdetail.money);
                    }
                    if (mdetail.yb != 0)
                    {
                        CreateCoinIcon("coin2", mdetail.yb);
                    }
                    if (mdetail.bndyb != 0)
                    {
                        CreateCoinIcon("coin3", mdetail.bndyb);
                    }
                    for (int i = 0; i < mdetail.itms.Count; i++)
                    {
                        a3_BagItemData data = mdetail.itms[i];
                        icon = IconImageMgr.getInstance().createA3ItemIcon(data, true, data.num);
                        icon.transform.SetParent(itmGrid.transform, false);
                        if (data.num <= 1)
                        {
                            icon.transform.FindChild("num").gameObject.SetActive(false);
                        }

                        BaseButton bs_bt = new BaseButton(icon.transform);
                        bs_bt.onClick = delegate(GameObject go) { this.onMailItemClick(data); };
                    }

                    if (mdetail.ms.got_itm)
                    {//!--已领取
                        del2.gameObject.SetActive(true);
                        tx_infos.gameObject.SetActive(true);
                        tx_infos.text = ContMgr.getCont("mail_hint_0");
                        for (int i = 0; i < itmGrid.transform.childCount; i++)
                        {
                            Destroy(itmGrid.transform.GetChild(i).gameObject);
                        }
                        for (int i = 0; i < coinGrid.transform.childCount; i++)//创造网格
                        {
                            Destroy(coinGrid.transform.GetChild(i).gameObject);
                        }
                    }
                    else
                    {//!--未领取
                        del1.gameObject.SetActive(true);
                        get.gameObject.SetActive(true);
                    }
                }
            }
        }
Example #10
0
        public override void init()
        {
            new BaseButton(getTransformByPath("Button")).onClick = (GameObject go) => bttttt();

            compose_obj          = getGameObjectByPath("compose");
            image_lv             = getGameObjectByPath(path_str + "lv/scrollview/Image");
            contain_lv           = getGameObjectByPath(path_str + "lv/scrollview/grid");
            contain_quality      = getGameObjectByPath(path_str + "quality/scrollview/grid");
            contain_name         = getGameObjectByPath(path_str + "name/scrollview/grid");
            list_compose_contain = new List <GameObject> {
                contain_lv, contain_quality, contain_name
            };
            BaseButton choselv_btn      = new BaseButton(getTransformByPath(path_str + "lv/Button"));
            BaseButton chosequality_btn = new BaseButton(getTransformByPath(path_str + "quality/Button"));
            BaseButton chosename_btn    = new BaseButton(getTransformByPath(path_str + "name/Button"));

            choselv_btn.onClick = chosequality_btn.onClick = chosename_btn.onClick = (GameObject go) => OpenchoseOnClick(go, list_compose_contain);
            image_compose_obj   = getGameObjectByPath("compose/left/bg/down/scrollview/Image");
            contain_compose_obj = getGameObjectByPath("compose/left/bg/down/scrollview/contain");
            compose_lv_txt      = getComponentByPath <Text>("compose/left/bg/top/lv/chose");
            compose_quality_txt = getComponentByPath <Text>("compose/left/bg/top/quality/chose");
            compose_name_txt    = getComponentByPath <Text>("compose/left/bg/top/name/chose");
            exp_obj             = getComponentByPath <Slider>("compose/left/exp/exp");
            stamin_obj          = getComponentByPath <Slider>("compose/left/strength/strength");
            exp     = getComponentByPath <Text>("compose/left/exp/Text");
            stamin  = getComponentByPath <Text>("compose/left/strength/Text");
            money   = getComponentByPath <Text>("compose/left/need_money/num");
            buy_num = getComponentByPath <Text>("compose/left/nub/num");
            new BaseButton(getTransformByPath("compose/left/nub/right_btn")).onClick = (GameObject go) => addnum();
            new BaseButton(getTransformByPath("compose/left/nub/left_btn")).onClick  = (GameObject go) => reducenum();
            compose_bymoney_btn         = new BaseButton(getTransformByPath("compose/left/need_money"));
            compose_bymoney_btn.onClick = (GameObject go) => compose_bymonry();



            list_obj = getGameObjectByPath("list");
            new BaseButton(getTransformByPath("list/close_btn")).onClick = (GameObject go) => openorcloselistOnClock(false);
            new BaseButton(getTransformByPath("close/list_btn")).onClick = (GameObject go) => openorcloselistOnClock(true);
            list_contain_lv      = getGameObjectByPath("list/top/lv/scrollview/grid");
            list_contain_quality = getGameObjectByPath("list/top/quality/scrollview/grid");
            list_contain_name    = getGameObjectByPath("list/top/name/scrollview/grid");
            list_list_contain    = new List <GameObject> {
                list_contain_lv, list_contain_quality, list_contain_name
            };
            BaseButton list_choselv_btn      = new BaseButton(getTransformByPath("list/top/lv/Button"));
            BaseButton list_chosequality_btn = new BaseButton(getTransformByPath("list/top/quality/Button"));
            BaseButton list_chosename_btn    = new BaseButton(getTransformByPath("list/top/name/Button"));

            list_choselv_btn.onClick = list_chosequality_btn.onClick = list_chosename_btn.onClick = (GameObject go) => OpenchoseOnClick(go, list_list_contain);
            image_list_obj           = getGameObjectByPath("list/down/scrollview/Image");
            contain_list_obj         = getGameObjectByPath("list/down/scrollview/grid");
            list_lv_txt      = getComponentByPath <Text>("list/top/lv/chose");
            list_quality_txt = getComponentByPath <Text>("list/top/quality/chose");
            list_name_txt    = getComponentByPath <Text>("list/top/name/chose");



            dress_obj   = getGameObjectByPath("dress");
            dress_bg    = getGameObjectByPath("dress/bg");
            decomposeBg = getGameObjectByPath("haverunestones/Image");



            decompose_obj = getGameObjectByPath("decompose");
            new BaseButton(getTransformByPath("haverunestones/Image/btn")).onClick = (GameObject go) => openorclsoeDecompose(true);
            new BaseButton(getTransformByPath("decompose/close_btn")).onClick      = (GameObject go) => openorclsoeDecompose(false);
            contain_decompose     = getGameObjectByPath("decompose/scroll_view/contain");
            image_decompose       = getGameObjectByPath("decompose/scroll_view/icon");
            decompose_btn         = new BaseButton(getTransformByPath("decompose/info_bg/btn"));
            decompose_btn.onClick = decomposesOnclick;
            white = getComponentByPath <Toggle>("decompose/info_bg/Toggle_all/Toggle_white");
            white.onValueChanged.AddListener(delegate(bool ison)
            {
                if (ison)
                {
                    ShowComposeRuneston(1);
                }
                else
                {
                    DesComposeRuneston(1);
                }
            });
            green = getComponentByPath <Toggle>("decompose/info_bg/Toggle_all/Toggle_green");
            green.onValueChanged.AddListener(delegate(bool ison)
            {
                if (ison)
                {
                    ShowComposeRuneston(2);
                    if (white.isOn == false)
                    {
                        white.isOn = true;
                    }
                }
                else
                {
                    DesComposeRuneston(2);
                }
            });
            blue = getComponentByPath <Toggle>("decompose/info_bg/Toggle_all/Toggle_blue");
            blue.onValueChanged.AddListener(delegate(bool ison)
            {
                if (ison)
                {
                    ShowComposeRuneston(3);
                    if (green.isOn == false)
                    {
                        green.isOn = true;
                    }
                }
                else
                {
                    DesComposeRuneston(3);
                }
            });
            purple = getComponentByPath <Toggle>("decompose/info_bg/Toggle_all/Toggle_puple");
            purple.onValueChanged.AddListener(delegate(bool ison)
            {
                if (ison)
                {
                    ShowComposeRuneston(4);
                    if (blue.isOn == false)
                    {
                        blue.isOn = true;
                    }
                }
                else
                {
                    DesComposeRuneston(4);
                }
            });
            orange = getComponentByPath <Toggle>("decompose/info_bg/Toggle_all/Toggle_orange");
            orange.onValueChanged.AddListener(delegate(bool ison)
            {
                if (ison)
                {
                    ShowComposeRuneston(5);
                    if (purple.isOn == false)
                    {
                        purple.isOn = true;
                    }
                }
                else
                {
                    DesComposeRuneston(5);
                }
            });



            image_hanvRunestones   = getGameObjectByPath("haverunestones/scrollview/icon");
            contain_haveRunestones = getGameObjectByPath("haverunestones/scrollview/contain");



            composebtn_image              = getGameObjectByPath("Panel/compose_btn/Image");
            dressbtn_image                = getGameObjectByPath("Panel/dress_btn/Image");
            rct_contain_haveRunestones    = contain_compose_obj.GetComponent <RectTransform>();
            rct_scrollview_haveRunestones = getGameObjectByPath("haverunestones/scrollview").GetComponent <RectTransform>();
            new BaseButton(getTransformByPath("close/close_btn")).onClick = (GameObject go) => InterfaceMgr.getInstance().close(InterfaceMgr.A3_RUNESTONE);
            compose_btn       = new BaseButton(getTransformByPath("Panel/compose_btn"));
            dress_btn         = new BaseButton(getTransformByPath("Panel/dress_btn"));
            dress_btn.onClick = compose_btn.onClick = btnSwitch;

            //初始化
            ScrollControler();
            //
            InitchosebtnOnclick(list_compose_contain, 1);
            InitchosebtnOnclick(list_list_contain, 2);
            LvStaminaInfos();
            //
            InitSccrollHaveRunestonsGrids();
            InitBagHaveRunestones();
            //
            InitDress();
        }
Example #11
0
        public MiniMapItem(Transform trans, Quaternion rotation) : base(trans)
        {
            this.mapRotation = rotation;
            SXML      sXML            = XMLMgr.instance.GetSXML("mappoint", "");
            int       num             = worldmap.mapid * 100;
            Transform transformByPath = base.getTransformByPath("npc");

            transformByPath.localRotation = rotation;
            for (int i = 0; i < transformByPath.childCount; i++)
            {
                Transform child = transformByPath.GetChild(i);
                child.localRotation = Quaternion.Inverse(rotation);
                this.lNpc.Add(child.gameObject);
            }
            Transform transformByPath2 = base.getTransformByPath("way");

            transformByPath2.localRotation = rotation;
            for (int j = 0; j < transformByPath2.childCount; j++)
            {
                Transform child2 = transformByPath2.GetChild(j);
                child2.localRotation = Quaternion.Inverse(rotation);
            }
            Transform transformByPath3 = base.getTransformByPath("monster");

            transformByPath3.localRotation = rotation;
            for (int k = 0; k < transformByPath3.childCount; k++)
            {
                Transform child3 = transformByPath3.GetChild(k);
                child3.localRotation = Quaternion.Inverse(rotation);
                this.lMonster.Add(child3.gameObject);
                Transform transform = child3.FindChild("lv");
                bool      flag      = transform == null;
                if (!flag)
                {
                    Text component = transform.GetComponent <Text>();
                    SXML node      = sXML.GetNode("p", "id==" + (num + int.Parse(child3.gameObject.name)));
                    int  @int      = node.getInt("lv_up");
                    int  int2      = node.getInt("lv");
                    component.text = ContMgr.getCont("worldmap_lv", new string[]
                    {
                        @int.ToString(),
                        int2.ToString()
                    });
                }
            }
            this.map = base.getTransformByPath("map");
            this.map.localRotation = rotation;
            EventTriggerListener.Get(base.gameObject).onPointClick = new EventTriggerListener.VectorDelegate(this.onMapClick);
            Transform transform2 = base.transform.FindChild("namebt");
            bool      flag2      = transform2 != null;

            if (flag2)
            {
                Transform transform3 = transform2.FindChild("con");
                bool      flag3      = transform3 == null;
                if (!flag3)
                {
                    this.goCon = transform3.gameObject;
                    BaseButton baseButton = new BaseButton(transform2.FindChild("mainbt"), 1, 1);
                    baseButton.onClick = delegate(GameObject go)
                    {
                        this.goCon.SetActive(!this.goCon.active);
                    };
                    this.goCon.SetActive(false);
                }
            }
        }
Example #12
0
        private void RefreshMembersList(GameEvent e)
        {
            this.selectedMember = null;
            this.select.gameObject.SetActive(false);
            this.select.SetParent(this.content.parent);
            Transform transform         = base.transform.FindChild("cells/scroll/0");
            int       num               = 0;
            List <A3_LegionMember> list = new List <A3_LegionMember>(ModelBase <A3_LegionModel> .getInstance().members.Values);
            int num2 = list.Count;

            Transform[] componentsInChildren = this.content.GetComponentsInChildren <Transform>(true);
            for (int i = 0; i < componentsInChildren.Length; i++)
            {
                Transform transform2 = componentsInChildren[i];
                bool      flag       = transform2.parent == this.content.transform;
                if (flag)
                {
                    bool flag2 = num < list.Count;
                    if (flag2)
                    {
                        this.SetLine(transform2, list[num]);
                        bool flag3 = list[num].lastlogoff > 0;
                        if (flag3)
                        {
                            num2--;
                        }
                        List <A3_LegionMember> tp = new List <A3_LegionMember>();
                        tp.Add(list[num]);
                        BaseButton baseButton = new BaseButton(transform2.transform, 1, 1);
                        baseButton.onClick = delegate(GameObject g)
                        {
                            debug.Log(tp[0].name);
                            this.select.SetParent(g.transform);
                            this.select.localPosition = Vector3.zero;
                            this.select.localScale    = Vector3.one;
                            this.select.gameObject.SetActive(true);
                            this.selectedMember = g;
                        };
                        this.gbtn[transform2.gameObject] = baseButton;
                        transform2.gameObject.SetActive(true);
                        num++;
                    }
                    else
                    {
                        bool flag4 = this.gbtn.ContainsKey(transform2.gameObject);
                        if (flag4)
                        {
                            this.gbtn[transform2.gameObject] = null;
                        }
                        transform2.gameObject.SetActive(false);
                    }
                }
            }
            bool flag5 = list.Count >= this.gos.Count;

            if (flag5)
            {
                for (int j = this.gos.Count; j < list.Count; j++)
                {
                    GameObject gameObject = UnityEngine.Object.Instantiate <GameObject>(transform.gameObject);
                    gameObject.transform.SetParent(this.content);
                    gameObject.transform.localScale = Vector3.one;
                    gameObject.SetActive(true);
                    this.SetLine(gameObject.transform, list[j]);
                    bool flag6 = list[num].lastlogoff > 0;
                    if (flag6)
                    {
                        num2--;
                    }
                }
            }
            this.content.GetComponent <RectTransform>().sizeDelta     = new Vector2(0f, this.content.GetComponent <GridLayoutGroup>().cellSize.y *(float)ModelBase <A3_LegionModel> .getInstance().members.Count);
            base.transform.FindChild("zx").GetComponent <Text>().text = string.Concat(new object[]
            {
                list.Count,
                "/",
                ModelBase <A3_LegionModel> .getInstance().myLegion.member_max,
                "(",
                num2,
                "在线)"
            });
        }
Example #13
0
        public override void init()
        {
            Instance     = this;
            tfParentWait = transform.FindChild("wait");
            tfParentWait.gameObject.SetActive(false);
            imgProcess = tfParentWait.FindChild("waitBG").GetComponent <Image>();
            (BtnWait = new BaseButton(tfParentWait.FindChild("waitBG/btnDoWait"))).onClick = OnWaitBtnClick;
            actionImage = tfParentWait.FindChild("waitBG/btnDoWait").GetComponent <Image>();
            winKillMon  = transform.FindChild("killmon").gameObject;
            winKillMon.SetActive(false);
            winKillDragon = transform.FindChild("killDragon").gameObject;
            winKillDragon.SetActive(false);
            tfSubmitItem        = transform.FindChild("submitItem");
            tfSubmitItemMainCon = tfSubmitItem.FindChild("mask/scrollview/rect");
            tfSubmitItemCon     = tfSubmitItem.FindChild("mask/scrollview/rect/con");
            tfFocus             = tfSubmitItem.FindChild("focus");
            tfFocus.gameObject.SetActive(false);
            tfSubmitItem.gameObject.SetActive(false);
            tfBtnStart = winKillMon.transform.FindChild("btnStart");
            Transform tfBtnCancel = winKillMon.transform.FindChild("btnDontStart");

            new BaseButton(tfBtnStart).onClick  = OnStartBtnClick;
            new BaseButton(tfBtnCancel).onClick = OnCancelBtnClick;
            new BaseButton(transform.FindChild("submitItem/closeBtn")).onClick = (btnClose) => tfSubmitItem.gameObject.SetActive(false);
            new BaseButton(transform.FindChild("killmon/closeArea")).onClick   = (go) => go.transform.parent.gameObject.SetActive(false);
            new BaseButton(tfSubmitItem.FindChild("btnOK")).onClick            = (go) =>
            {
                if (submitItemIId != 0 && curTaskId != 0)
                {
                    A3_TaskProxy.getInstance().SendSubmit(curTaskId, submitItemIId);
                }
                tfSubmitItem.gameObject.SetActive(false);
            };
            //transform.SetParent(skillbar.instance.transform);
            A3_TaskProxy.getInstance().addEventListener(A3_TaskProxy.ON_TASK_REFRESH, OnCheck);
            A3_TaskProxy.getInstance().addEventListener(A3_TaskProxy.ON_GET_NEW_TASK, OnCheck);

            taskOptElement = new Dictionary <int, TaskOptElement>();
            Dictionary <int, TaskData> listTask = A3_TaskModel.getInstance().GetDicTaskData();
            List <int> idx = new List <int>(listTask.Keys);

            for (int i = 0; i < idx.Count; i++)
            {
                int taskId = idx[i];
                if (listTask[taskId].release_tm > 0)
                {
                    if (listTask[taskId].lose_tm > muNetCleint.instance.CurServerTimeStamp)
                    {
                        taskOptElement[taskId] =
                            new TaskOptElement(taskId,
                                               isKeepingKillMon: true,
                                               isTaskMonsterAlive: true //,
                                                                        //timeKillTerminal: A3_TaskModel.getInstance().GetTaskDataById(taskId).lose_tm
                                               );
                        taskOptElement[taskId].InitUi(
                            liteMinimapTaskTimer: a3_liteMinimap.instance.GetTaskPage(taskId)?.transform.FindChild("name/timer").GetComponent <Text>()
                            );
                    }
                }
            }
            Instance.name         = "A3_TaskOpt";
            waitThresholdDistance = XMLMgr.instance.GetSXML("task.range").getFloat("action_range") / GameConstant.PIXEL_TRANS_UNITYPOS;
            scaleIcon             = transform.FindChild("submitItem/iconConfig")?.localScale ?? Vector3.zero;
            new BaseButton(winKillDragon.transform.FindChild("btnStart")).onClick = (go) =>
            {
                uint dragonId = A3_SlayDragonModel.getInstance().GetUnlockedDragonId();
                int  diffLv   = A3_SlayDragonModel.getInstance().GetUnlockedDiffLv();
                A3_SlayDragonProxy.getInstance().SendGo();
            };
            new BaseButton(winKillDragon.transform.FindChild("btnNope")).onClick = (go) => winKillDragon.SetActive(false);
            if (!IsInvoking("RunTimer"))
            {
                InvokeRepeating("RunTimer", 0f, 1.0f);
            }



            getComponentByPath <Text>("killmon/bg/desc").text           = ContMgr.getCont("A3_TaskOpt_0");
            getComponentByPath <Text>("killmon/btncreatteam/Text").text = ContMgr.getCont("A3_TaskOpt_1");
            getComponentByPath <Text>("killmon/btnDontStart/Text").text = ContMgr.getCont("A3_TaskOpt_2");
            getComponentByPath <Text>("killmon/btnStart/Text").text     = ContMgr.getCont("A3_TaskOpt_3");
            getComponentByPath <Text>("wait/action_text").text          = ContMgr.getCont("A3_TaskOpt_4");
            getComponentByPath <Text>("submitItem/title/Text").text     = ContMgr.getCont("A3_TaskOpt_5");
            getComponentByPath <Text>("submitItem/btnOK/text").text     = ContMgr.getCont("A3_TaskOpt_6");
            getComponentByPath <Text>("killDragon/bg/desc").text        = ContMgr.getCont("A3_TaskOpt_7");
            getComponentByPath <Text>("killDragon/btnStart/Text").text  = ContMgr.getCont("A3_TaskOpt_8");
            getComponentByPath <Text>("killDragon/btnNope/Text").text   = ContMgr.getCont("A3_TaskOpt_2");
        }
        int maxPageNum_left = 6;  //最大页数

        public override void init()
        {
            money = transform.FindChild("money_bg/money").GetComponent <Text>();
            gold  = transform.FindChild("gem_bg/stone").GetComponent <Text>();
            coin  = transform.FindChild("bdgem_bg/bindstone").GetComponent <Text>();
            textPageIndex_right = this.getComponentByPath <Text>("page_right/Text");
            textPageIndex_left  = this.getComponentByPath <Text>("page_left/Text");

            itemListView  = transform.FindChild("bag_scroll/scroll_view/contain").gameObject;
            item_Parent   = itemListView.GetComponent <GridLayoutGroup>();
            houseListView = transform.FindChild("house_scroll/scroll_view/contain").gameObject;
            house_Parent  = houseListView.GetComponent <GridLayoutGroup>();
            BaseButton btn_close = new BaseButton(transform.FindChild("btn_close"));

            btn_close.onClick = onclose;
            BaseButton close_btn = new BaseButton(transform.FindChild("close_btn"));

            close_btn.onClick = onclose;
            new BaseButton(transform.FindChild("money_bg/money/add_money")).onClick = (GameObject go) => {
                InterfaceMgr.getInstance().ui_async_open(InterfaceMgr.A3_EXCHANGE);
                a3_exchange.Instance.transform.SetSiblingIndex(this.transform.GetSiblingIndex() + 1);
            };
            new BaseButton(transform.FindChild("gem_bg/stone/add_stone")).onClick = (GameObject go) => {
                InterfaceMgr.getInstance().ui_async_open(InterfaceMgr.A3_RECHARGE);
                a3_Recharge.Instance?.transform.SetSiblingIndex(this.transform.GetSiblingIndex() + 1);
            };
            new BaseButton(transform.FindChild("bdgem_bg/bindstone/add_bangstone")).onClick = (GameObject go) =>
            {
                InterfaceMgr.getInstance().ui_async_open(InterfaceMgr.A3_RECHARGE);
            };
            BaseButton btn_open = new BaseButton(transform.FindChild("panel_open/open"));

            btn_open.onClick = onOpenLock;

            BaseButton btn_close_open = new BaseButton(transform.FindChild("panel_open/close"));

            btn_close_open.onClick = onCloseOpen;

            scrollControler = new ScrollControler();
            ScrollRect scroll = transform.FindChild("bag_scroll/scroll_view").GetComponent <ScrollRect>();

            scrollControler.create(scroll);
            open_bar = transform.FindChild("panel_open/Scrollbar").GetComponent <Scrollbar>();
            open_bar.onValueChanged.AddListener(onNumChange);

            for (int i = 50; i < itemListView.transform.childCount; i++)
            {
                if (i >= a3_BagModel.getInstance().curi)
                {
                    GameObject lockig = itemListView.transform.GetChild(i).FindChild("lock").gameObject;
                    lockig.SetActive(true);
                    int        tag = i + 1;
                    BaseButton btn = new BaseButton(lockig.transform);
                    btn.onClick = delegate(GameObject go) { this.onClickOpenBagLock(lockig, tag); };
                }
            }
            for (int i = 10; i < houseListView.transform.childCount; i++)
            {
                if (i >= a3_BagModel.getInstance().house_curi)
                {
                    GameObject lockig = houseListView.transform.GetChild(i).FindChild("lock").gameObject;
                    lockig.SetActive(true);
                    int        tag = i + 1;
                    BaseButton btn = new BaseButton(lockig.transform);
                    btn.onClick = delegate(GameObject go) { this.onClickOpenHouseLock(lockig, tag); };
                }
            }
            for (int i = 1; i <= 2; i++)
            {
                Toggle tog = transform.FindChild("panel_open/open_choose/Toggle" + i).GetComponent <Toggle>();
                int    tag = i;
                tog.onValueChanged.AddListener(delegate(bool isOn)
                {
                    open_choose_tag = tag;
                    checkNumChange();
                });
            }
            Toggle auto = transform.FindChild("auto").GetComponent <Toggle>();

            auto.onValueChanged.AddListener(delegate(bool isOn)
            {
                is_auto = isOn;
            });


            new BaseButton(transform.FindChild("page_right/right")).onClick = (GameObject go) =>
            {
                if (pageIndex_right < maxPageNum_right)
                {
                    pageIndex_right++;
                }

                show_page_right();
            };
            new BaseButton(transform.FindChild("page_right/left")).onClick = (GameObject go) =>
            {
                if (pageIndex_right > 1)
                {
                    pageIndex_right--;
                }
                show_page_right();
            };

            new BaseButton(transform.FindChild("page_left/right")).onClick = (GameObject go) =>
            {
                if (pageIndex_left < maxPageNum_left)
                {
                    pageIndex_left++;
                }
                show_page_left();
            };
            new BaseButton(transform.FindChild("page_left/left")).onClick = (GameObject go) =>
            {
                if (pageIndex_left > 1)
                {
                    pageIndex_left--;
                }
                show_page_left();
            };
            InvokeRepeating("OnShowAchievementPage_right", 0, 0.3f);
            InvokeRepeating("OnShowAchievementPage_left", 0, 0.3f);


            getComponentByPath <Text>("auto/Text").text            = ContMgr.getCont("a3_warehouse_0");
            getComponentByPath <Text>("close_btn/Text").text       = ContMgr.getCont("a3_warehouse_1");
            getComponentByPath <Text>("panel_open/Text").text      = ContMgr.getCont("a3_warehouse_2");
            getComponentByPath <Text>("panel_open/open/Text").text = ContMgr.getCont("a3_warehouse_3");
            getComponentByPath <Text>("panel_open/open_choose/Toggle1/Label").text = ContMgr.getCont("a3_warehouse_4");
            getComponentByPath <Text>("panel_open/open_choose/Toggle2/Label").text = ContMgr.getCont("a3_warehouse_5");
            getComponentByPath <Text>("panel_open/title/Text").text = ContMgr.getCont("a3_warehouse_6");
        }
Example #15
0
        private void OnShowOptionUi()
        {
            this.conIcon.gameObject.SetActive(false);
            this.conOption.parent.gameObject.SetActive(true);
            this.bg_task.gameObject.SetActive(false);
            NpcRole    npc        = dialog.m_npc;
            List <int> listTaskId = npc.listTaskId;
            bool       flag       = listTaskId != null;

            if (flag)
            {
                for (int i = 0; i < listTaskId.Count; i++)
                {
                    int        taskId     = listTaskId[i];
                    string     taskName   = this.tkModel.GetTaskDataById(taskId).taskName;
                    bool       flag2      = this.tkModel.GetTaskDataById(taskId).taskT == TaskType.MAIN;
                    GameObject gameObject = UnityEngine.Object.Instantiate <GameObject>(this.optionTemp);
                    switch (this.tkModel.GetTaskDataById(taskId).taskT)
                    {
                    case TaskType.MAIN:
                        gameObject.transform.FindChild("sign/main").gameObject.SetActive(true);
                        break;

                    case TaskType.BRANCH:
                        gameObject.transform.FindChild("sign/branch").gameObject.SetActive(true);
                        break;

                    case TaskType.ENTRUST:
                        gameObject.transform.FindChild("sign/entrust").gameObject.SetActive(true);
                        break;

                    case TaskType.CLAN:
                        gameObject.transform.FindChild("sign/clan").gameObject.SetActive(true);
                        break;
                    }
                    gameObject.transform.FindChild("Text").GetComponent <Text>().text = taskName;
                    gameObject.transform.SetParent(this.conOption, false);
                    gameObject.SetActive(true);
                    BaseButton baseButton = new BaseButton(gameObject.transform, 1, 1);
                    baseButton.onClick         = new Action <GameObject>(this.OnOptionBtnClick);
                    baseButton.gameObject.name = taskId.ToString();
                }
            }
            bool flag3 = npc.openid != "";

            if (flag3)
            {
                GameObject gameObject2 = UnityEngine.Object.Instantiate <GameObject>(this.optionTemp);
                gameObject2.transform.FindChild("sign/func").gameObject.SetActive(true);
                bool flag4 = npc.openid == "a3_warehouse";
                if (flag4)
                {
                    gameObject2.transform.FindChild("Text").GetComponent <Text>().text = "仓库";
                }
                bool flag5 = npc.openid == "A3_FindBesto";
                if (flag5)
                {
                    gameObject2.transform.FindChild("Text").GetComponent <Text>().text = "藏宝图兑换";
                }
                bool flag6 = npc.openid == "a3_resetlvl";
                if (flag6)
                {
                    gameObject2.transform.FindChild("Text").GetComponent <Text>().text = "转生";
                }
                bool flag7 = npc.openid == "A3_Smithy";
                if (flag7)
                {
                    gameObject2.transform.FindChild("Text").GetComponent <Text>().text = "铁匠铺";
                }
                bool flag8 = npc.openid == "a3_npc_shop";
                if (flag8)
                {
                    gameObject2.transform.FindChild("Text").GetComponent <Text>().text = "NPC商店";
                    this.npc_id = npc.id;
                }
                bool flag9 = npc.openid == "a3_legion_dart";
                if (flag9)
                {
                    gameObject2.transform.FindChild("Text").GetComponent <Text>().text = "军团运镖";
                }
                gameObject2.transform.SetParent(this.conOption, false);
                gameObject2.SetActive(true);
                BaseButton baseButton2 = new BaseButton(gameObject2.transform, 1, 1);
                baseButton2.onClick         = new Action <GameObject>(this.OnOptionBtnClick);
                baseButton2.gameObject.name = npc.openid;
            }
        }
Example #16
0
        public MiniMapItem(Transform trans, Quaternion rotation)
            : base(trans)
        {
            mapRotation = rotation;
            SXML      xml   = XMLMgr.instance.GetSXML("mappoint");
            int       mapid = worldmap.mapid * 100;
            Transform tNpc  = getTransformByPath("npc");

            tNpc.localRotation = rotation;
            //int lv_up = (int)PlayerModel.getInstance().up_lvl;
            //int lv = (int)PlayerModel.getInstance().lvl;

            for (int i = 0; i < tNpc.childCount; i++)
            {
                Transform t = tNpc.GetChild(i);
                t.localRotation = Quaternion.Inverse(rotation);
                lNpc.Add(t.gameObject);
                //BaseButton bt = new BaseButton(t);
                //bt.onClick = onclick;


                //Transform transTxt = t.FindChild("lv");
                //if (transTxt == null)
                //    continue;
                //Text txt = transTxt.GetComponent<Text>();
                //SXML tempxml = xml.GetNode("p", "id==" + (mapid + int.Parse(t.gameObject.name)));
                //int itemLv_up = tempxml.getInt("lv_up");
                //int itemLv = tempxml.getInt("lv");
                //txt.text = ContMgr.getCont("worldmap_lv", itemLv_up.ToString(), itemLv.ToString());

                //t.GetComponent<Button>().interactable = (lv_up > itemLv_up) || (lv_up == itemLv_up && lv >= itemLv);
            }

            Transform tWay = getTransformByPath("way");

            tWay.localRotation = rotation;
            for (int i = 0; i < tWay.childCount; i++)
            {
                Transform t = tWay.GetChild(i);
                t.localRotation = Quaternion.Inverse(rotation);
            }

            Transform tMonster = getTransformByPath("monster");

            tMonster.localRotation = rotation;
            for (int i = 0; i < tMonster.childCount; i++)
            {
                Transform t = tMonster.GetChild(i);
                t.localRotation = Quaternion.Inverse(rotation);
                lMonster.Add(t.gameObject);
                //BaseButton bt = new BaseButton(t);
                //bt.onClick = onclick;



                Transform transTxt = t.FindChild("lv");
                if (transTxt == null)
                {
                    continue;
                }
                Text txt       = transTxt.GetComponent <Text>();
                SXML tempxml   = xml.GetNode("p", "id==" + (mapid + int.Parse(t.gameObject.name)));
                int  itemLv_up = tempxml.getInt("lv_up");
                int  itemLv    = tempxml.getInt("lv");
                txt.text = ContMgr.getCont("worldmap_lv", itemLv_up.ToString(), itemLv.ToString());

                //   t.GetComponent<Button>().interactable = (lv_up > itemLv_up) || (lv_up == itemLv_up && lv >= itemLv);
            }
            map = getTransformByPath("map");
            map.localRotation = rotation;
            EventTriggerListener.Get(gameObject).onPointClick = onMapClick;
            Transform main = transform.FindChild("namebt");

            if (main != null)
            {
                Transform con = main.FindChild("con");
                if (con == null)
                {
                    return;
                }

                goCon = con.gameObject;
                //for (int i = 0; i < con.GetChildCount(); i++)
                //{
                //    BaseButton bt = new BaseButton(con.GetChild(i));
                //    bt.onClick = onmapClick;
                //}


                BaseButton mainbt = new BaseButton(main.FindChild("mainbt"));
                mainbt.onClick = (GameObject go) =>
                {
                    goCon.SetActive(!goCon.active);
                };
                goCon.SetActive(false);
            }
        }
Example #17
0
        //刷新指定成就的状态
        private void OnRefreshPageState(GameObject page, AchievementData data)
        {
            //TODO 刷新指定的page
            Text       textDrgee   = page.transform.FindChild("text_state/text_plan").GetComponent <Text>();
            Slider     sliderState = page.transform.FindChild("expbar/slider").GetComponent <Slider>();
            BaseButton btnGet      = new BaseButton(page.transform.FindChild("btn_get"));
            Transform  conPrize    = page.transform.FindChild("con_prize");
            Text       numtext     = null;
            var        numtra      = page.transform.FindChild("con_prize/panel_0/icon/Text");

            if (numtra != null)
            {
                numtext = numtra.GetComponent <Text>();
            }

            switch (data.state)
            {
            case AchievementState.UNREACHED:
                btnGet.gameObject.SetActive(false);
                conPrize.GetChild(0).gameObject.SetActive(true);
                conPrize.GetChild(1).gameObject.SetActive(false);
                if (data.bndyb == 0)
                {
                    numtext.transform.parent.gameObject.SetActive(false);
                    conPrize.GetComponent <Image>().enabled = false;
                }
                numtext.text = data.bndyb.ToString();
                break;

            case AchievementState.REACHED:
                btnGet.gameObject.SetActive(true);
                btnGet.onClick = OnGetPrzieClick;
                conPrize.GetChild(0).gameObject.SetActive(true);
                conPrize.GetChild(1).gameObject.SetActive(false);
                if (data.bndyb == 0)
                {
                    numtext.transform.parent.gameObject.SetActive(false);
                    conPrize.GetComponent <Image>().enabled = false;
                }
                numtext.text = data.bndyb.ToString();
                break;

            case AchievementState.RECEIVED:
                btnGet.gameObject.SetActive(false);
                conPrize.GetChild(0).gameObject.SetActive(false);
                conPrize.GetChild(1).gameObject.SetActive(true);
                if (data.bndyb == 0)
                {
                    numtext.transform.parent.gameObject.SetActive(false);
                }
                numtext.text = "";
                break;

            default:
                break;
            }

            textDrgee.text = "(" + (data.degree > data.condition ? data.condition : data.degree) + "/" + data.condition + ")";

            sliderState.maxValue = data.condition;
            sliderState.value    = data.degree;
        }
Example #18
0
        public override void init()
        {
            _instance = this;
            ditu      = getComponentByPath <Text>("shijieditu");
            // PlayerModel.SendPosition();
            m_goWorldmap = getGameObjectByPath("worldmap");
            //vecBegin = m_goWorldmap.transform.position;
            //vecEnd = vecBegin;
            //vecEnd.y = 600f;
            //m_goWorldmap.transform.position = vecEnd;
            m_goMapcon = getGameObjectByPath("mapcon");

            btclose         = new BaseButton(getTransformByPath("btclose"));
            btclose.onClick = onClose;

            btGoCity         = new BaseButton(getTransformByPath("tabrole/gotomain"));
            btGoCity.onClick = onGotoCity;

            GameObject temp = getGameObjectByPath("tabrole/temp");

            temp.SetActive(false);
            tempH       = temp.GetComponent <RectTransform>().sizeDelta.y;
            npcList     = new ItemList(getTransformByPath("tabrole/npcmain"), 0, temp, onNpcListClick, onMonsterListClick, onWayListClick);
            monsterList = new ItemList(getTransformByPath("tabrole/monstermain"), 1, temp, onNpcListClick, onMonsterListClick, onWayListClick);
            wayList     = new ItemList(getTransformByPath("tabrole/waymain"), 2, temp, onNpcListClick, onMonsterListClick, onWayListClick);
            goTabrole   = getGameObjectByPath("tabrole");

            tick = new TickItem(onUpdate);

            tab = new TabControl();
            tab.onClickHanle = ontab;

            tab.create(getGameObjectByPath("tab"), gameObject, 0, 0);



            goP   = getGameObjectByPath("mapcon/p");
            goP1  = getGameObjectByPath("mapcon/icon");
            goP22 = transform.FindChild("worldmap/icon").gameObject;
            //BaseButton btnChangeLine = new BaseButton(getTransformByPath("tabrole/btnChangeLine"));
            //btnChangeLine.onClick = onBtnChangeLineClick;


            initWorldMap();



            if (m_goMapcon.activeInHierarchy && TeamProxy.getInstance().MyTeamData != null)
            {
                teampos();
            }
            //resfreshTeamPos();
            mapRotation = Quaternion.Euler(0f, 0f, 0f);


            getComponentByPath <Text>("tab/world/Text").text = ContMgr.getCont("worldmap_0");
            getComponentByPath <Text>("tab/map/Text").text   = ContMgr.getCont("worldmap_1");
            getComponentByPath <Text>("tabrole/monstermain/way/Text").text     = ContMgr.getCont("worldmap_2");
            getComponentByPath <Text>("tabrole/monstermain/monster/Text").text = ContMgr.getCont("worldmap_3");
            getComponentByPath <Text>("tabrole/npcmain/way/Text").text         = ContMgr.getCont("worldmap_2");
            getComponentByPath <Text>("tabrole/npcmain/monster/Text").text     = ContMgr.getCont("worldmap_3");
            getComponentByPath <Text>("tabrole/waymain/way/Text").text         = ContMgr.getCont("worldmap_2");
            getComponentByPath <Text>("tabrole/waymain/monster/Text").text     = ContMgr.getCont("worldmap_3");
            getComponentByPath <Text>("tabrole/gotomain/Text").text            = ContMgr.getCont("worldmap_4");
            getComponentByPath <Text>("tabrole/btnChangeLine/Text").text       = ContMgr.getCont("worldmap_5");
            getComponentByPath <Text>("worldmap/title/Text").text = ContMgr.getCont("worldmap_6");
            getComponentByPath <Text>("worldmap/name").text       = ContMgr.getCont("worldmap_7");
            getComponentByPath <Text>("shijieditu").text          = ContMgr.getCont("worldmap_7");
            transform.SetAsLastSibling();
        }
        public void Init()
        {
            _instance             = this;
            itemTeamInfoPrefabDic = new Dictionary <uint, itemTeamInfoPrefab>();
            BaseButton btnJoinTeam = new BaseButton(transform.FindChild("right/bottom/btnJoinTeam"));

            btnJoinTeam.onClick = onBtnJoinTeamClick;
            BaseButton btnCreateTeam = new BaseButton(transform.FindChild("right/bottom/btnCreateTeam"));

            btnCreateTeam.onClick = onBtnCreateClick;
            team_object           = transform.FindChild("team_object").gameObject;

            team_objectPanel = team_object.transform.FindChild("Dropdown").gameObject.GetComponent <Dropdown>();

            team_objectPanel.captionText.text = ContMgr.getCont("a3_teamPanel_16");
            for (int i = 0; i < team_objectPanel.options.Count; i++)
            {
                team_objectPanel.options[i].text = ContMgr.getCont("a3_teamPanel_" + (i + 16));
            }

            team_object.SetActive(false);

            BaseButton btn_1_object = new BaseButton(transform.FindChild("team_object/btn_1"));

            btn_1_object.onClick = onbtn_1_Click;
            BaseButton btn_0_object = new BaseButton(transform.FindChild("team_object/btn_0"));

            btn_0_object.onClick = onbtn_0_Click;

            BaseButton btnRefresh = new BaseButton(transform.FindChild("right/bottom/btnRefresh"));

            btnRefresh.onClick = onBtnRefreshClick;
            new BaseButton(transform.FindChild("right/bottom/speedteam")).onClick = (GameObject go) =>
            {
                InterfaceMgr.getInstance().ui_async_open(InterfaceMgr.A3_SPEEDTEAM);
            };


            Toggle togShowNearbyPanel = transform.FindChild("right/main/body/showNearby").GetComponent <Toggle>();

            togShowNearbyPanel.onValueChanged.AddListener(onShowNearby);
            getProfessionSprite();

            #region 初始化汉字
            getComponentByPath <Text>("title/txts/txtCaptain").text            = ContMgr.getCont("a3_teamPanel_0");
            getComponentByPath <Text>("title/txts/txtLvl").text                = ContMgr.getCont("a3_teamPanel_1");
            getComponentByPath <Text>("title/txts/txtKnightage").text          = ContMgr.getCont("a3_teamPanel_2");
            getComponentByPath <Text>("title/txts/txtMap").text                = ContMgr.getCont("a3_teamPanel_3");
            getComponentByPath <Text>("title/txts/txtMembCount").text          = ContMgr.getCont("a3_teamPanel_4");
            getComponentByPath <Text>("right/main/body/showNearby/Label").text = ContMgr.getCont("a3_teamPanel_5");
            getComponentByPath <Text>("right/bottom/btnRefresh/Text").text     = ContMgr.getCont("a3_teamPanel_6");
            getComponentByPath <Text>("right/bottom/btnCreateTeam/Text").text  = ContMgr.getCont("a3_teamPanel_7");
            getComponentByPath <Text>("right/bottom/btnJoinTeam/Text").text    = ContMgr.getCont("a3_teamPanel_8");
            getComponentByPath <Text>("right/bottom/speedteam/Text").text      = ContMgr.getCont("a3_teamPanel_9");
            getComponentByPath <Text>("itemPrefabs/itemTeamInfo/team_pre/4/apply/Text").text = ContMgr.getCont("a3_teamPanel_15");
            getComponentByPath <Text>("itemPrefabs/itemTeamInfo/btnWatch/Text").text         = ContMgr.getCont("a3_teamPanel_10");
            getComponentByPath <Text>("itemPrefabs/itemTeamInfo/txtLvl").text       = ContMgr.getCont("a3_teamPanel_1");
            getComponentByPath <Text>("itemPrefabs/itemTeamInfo/txtKnightage").text = ContMgr.getCont("a3_teamPanel_2");
            getComponentByPath <Text>("itemPrefabs/itemTeamInfo/txtMap").text       = ContMgr.getCont("a3_teamPanel_11");
            getComponentByPath <Text>("team_object/text").text           = ContMgr.getCont("a3_teamPanel_12");
            getComponentByPath <Text>("team_object/btn_0/text").text     = ContMgr.getCont("a3_teamPanel_13");
            getComponentByPath <Text>("team_object/btn_1/text").text     = ContMgr.getCont("a3_teamPanel_14");
            getComponentByPath <Text>("team_object/Dropdown/Label").text = ContMgr.getCont("a3_teamPanel_16");

            ScrollControler scrollControer0 = new ScrollControler();
            scrollControer0.create(getComponentByPath <ScrollRect>("right/main/body/Panel"));
            #endregion
        }
Example #20
0
        // 0:登陆,1:半价刷新
        public void RefreshData_lgAndbuy(int i, int nowday)
        {
            //i =0登陆=1半价
            Refresh_point();
            BaseButton btn      = new BaseButton(lst_obj[i].transform.FindChild("Button").transform);
            Text       btn_txt  = lst_obj[i].transform.FindChild("Button/Text").GetComponent <Text>();
            GameObject over_obj = lst_obj[i].transform.FindChild("over").gameObject;
            GameObject old_obj  = lst_obj[i].transform.FindChild("old").gameObject;
            GameObject new_obj  = lst_obj[i].transform.FindChild("new").gameObject;

            int thisday = A3_SevendayModel.getInstance().thisday;
            Dictionary <int, sevendayData> dic = A3_SevendayModel.getInstance().dic_data;

            btn_txt.text = i == 0 ? ContMgr.getCont("off_line_lq") : ContMgr.getCont("a3_sevenday_buy");
            if (i == 0)
            {
                btn.interactable = false;
                btn.gameObject.SetActive(false);
                old_obj.SetActive(false);
                new_obj.SetActive(false);
                over_obj.SetActive(false);
                if (nowday <= thisday)
                {
                    switch (dic[nowday].loginaed.state)
                    {
                    case 0:    /*可领没领*/
                        btn.interactable = true;
                        btn.gameObject.SetActive(true);
                        lst_obj[i].transform.SetAsFirstSibling();
                        break;

                    case 1:    /*领过*/
                        over_obj.SetActive(true);
                        lst_obj[i].transform.SetAsLastSibling();
                        break;

                    case 2:    /*不能领*/
                        btn.interactable = false;
                        btn.gameObject.SetActive(true);
                        break;

                    default:
                        break;
                    }
                }
                else
                {
                    new_obj.SetActive(true);
                }
            }
            else
            {
                btn.gameObject.SetActive(false);
                old_obj.SetActive(false);
                new_obj.SetActive(false);
                over_obj.SetActive(false);
                if (thisday == nowday)
                {
                    if (dic[nowday].halfbuy.isReceive)
                    {
                        over_obj.SetActive(true);
                        lst_obj[i].transform.SetAsLastSibling();
                    }
                    else
                    {
                        btn.gameObject.SetActive(true);
                    }
                }
                else if (nowday < thisday)
                {
                    old_obj.SetActive(true);
                }
                else if (nowday > thisday)
                {
                    new_obj.SetActive(true);
                }

                //btn_txt.text = i == 0 ? ContMgr.getCont("off_line_lq") : ContMgr.getCont("a3_sevenday_buy");
            }
        }
Example #21
0
        public override void init()
        {
            inittext();
            this.getEventTrigerByPath("left_bg/hero").onDrag = OnDrag;
            #region getobj
            contain       = getGameObjectByPath("right_bg/top/scroll_view/contain");
            image         = getGameObjectByPath("right_bg/top/scroll_view/image");
            c_jihuo_obj   = getGameObjectByPath("right_bg/com/Panel/jihuo");
            c_name        = getComponentByPath <Text>("right_bg/com/Panel/name");
            c_shuxing     = getComponentByPath <Text>("right_bg/com/Panel/shuxing");
            c_info        = getComponentByPath <Text>("right_bg/com/Panel/info");
            c_time        = getComponentByPath <Text>("right_bg/com/Panel/time");
            btn_buy_obj   = getGameObjectByPath("right_bg/down/buy");
            btn_dress_obj = getGameObjectByPath("right_bg/down/wear");
            buy_bg        = getGameObjectByPath("buy_bg");
            contain1      = getGameObjectByPath("buy_bg/scollBuy/content");
            panel         = getGameObjectByPath("right_bg/com/Panel");
            txt           = getGameObjectByPath("right_bg/com/txt");
            xiongjia_obj  = getGameObjectByPath("left_bg/xj");
            wuqi_obj      = getGameObjectByPath("left_bg/wq");
            jihuo_info    = getGameObjectByPath("right_bg/com/Panel/Panel");
            jihuo_bg      = getGameObjectByPath("jihuo_bg");
            tips          = getGameObjectByPath("tip");
            #endregion
            #region Btn
            btn_close             = new BaseButton(getTransformByPath("btn_close"));
            btn_close.onClick     = (GameObject go) => { InterfaceMgr.getInstance().close(InterfaceMgr.A3_FASHIONSHOW); };
            btn_retutn            = new BaseButton(getTransformByPath("left_bg/btn_retutn"));
            btn_retutn.onClick    = (GameObject go) => { returnOnclick(); };
            btn_buy_clsoe         = new BaseButton(getTransformByPath("buy_bg/touchClose"));
            btn_buy_clsoe.onClick = (GameObject go) => { buy_bg.SetActive(false); };
            btn_buy             = new BaseButton(getTransformByPath("right_bg/down/buy"));
            btn_buy.onClick     = (GameObject go) => { /*buy_bg.SetActive(true);*/ openbuyOnClick(go); };
            btn_dress           = new BaseButton(getTransformByPath("right_bg/down/wear"));
            btn_dress.onClick   = (GameObject go) => { dressinOnClick(go); };
            btn_buy_no          = new BaseButton(getTransformByPath("jihuo_bg/no"));
            btn_buy_no.onClick  = (GameObject go) => { jihuo_bg.SetActive(false); };
            btn_buy_yes         = new BaseButton(getTransformByPath("jihuo_bg/yes"));
            btn_buy_yes.onClick = (GameObject go) => {
                if (enough_item)
                {
                    jihuo_bg.SetActive(false);
                    a3_fashionshowProxy.getInstance().SendProxys(3, null, nowchooseid, jihuo_type);
                }
                else
                {
                    jihuo_bg.SetActive(false);
                    ArrayList data1 = new ArrayList();
                    data1.Add(a3_BagModel.getInstance().getItemDataById(need_id));
                    data1.Add(InterfaceMgr.A3_FASHIONSHOW);
                    InterfaceMgr.getInstance().ui_async_open(InterfaceMgr.A3_ITEMLACK, data1);
                }
                //flytxt.instance.fly(ContMgr.getCont("a3_fashionshow22"));
            };
            btn_tips               = new BaseButton(getTransformByPath("left_bg/btn_tip"));
            btn_tips.onClick       = (GameObject go) => { tips.SetActive(true); };
            btn_tips_close         = new BaseButton(getTransformByPath("tip/close"));
            btn_tips_close.onClick = (GameObject go) => { tips.SetActive(false); };


            szToggle1 = getComponentByPath <Toggle>("right_bg/down/shizhuang");
            szToggle1.onValueChanged.AddListener((bool v) =>
            {
                bool shows = szToggle1.isOn ? false : true;
                a3_fashionshowProxy.getInstance().SendProxys(4, null, show: shows);
            });
            fyToggle1 = getComponentByPath <Toggle>("right_bg/down/feiyi");
            fyToggle1.onValueChanged.AddListener((bool v) =>
            {
                if (!FunctionOpenMgr.instance.Check(FunctionOpenMgr.PET_SWING))
                {
                    flytxt.instance.fly(ContMgr.getCont("a3_fashionshow16"));
                    fyToggle1.isOn = true;
                }
                else
                {
                    if (!v)
                    {
                        m_proAvatar.set_wing(SelfRole._inst.get_wingid(), SelfRole._inst.get_windfxid());
                    }
                    else
                    {
                        m_proAvatar.set_wing(0, 0);
                    }
                }
                // bool shows = szToggle1.isOn ? false : true;
                //a3_fashionshowProxy.getInstance().SendProxys(4, null, show: shows);
            });
            #endregion
            #region TabControl
            _tabControl = new TabControl();
            _tabControl.onClickHanle = OnSwitch;
            _tabControl.create(getGameObjectByPath("right_bg/top/Panel"), this.gameObject);
            #endregion

            creatrveObj();
        }
Example #22
0
        // 其他刷新
        public void Refresh_other(int award_id, int nowday)
        {
            //nowday;当前选中天数 thisday:当天
            Refresh_point();
            int i;

            if (dic_three_info.ContainsKey(award_id))
            {
                i = dic_three_info[award_id];
            }
            else
            {
                return;
            }

            BaseButton btn      = new BaseButton(lst_obj[i].transform.FindChild("Button").transform);
            Text       btn_txt  = lst_obj[i].transform.FindChild("Button/Text").GetComponent <Text>();
            GameObject over_obj = lst_obj[i].transform.FindChild("over").gameObject;
            GameObject old_obj  = lst_obj[i].transform.FindChild("old").gameObject;
            GameObject new_obj  = lst_obj[i].transform.FindChild("new").gameObject;
            Text       name     = lst_obj[i].transform.FindChild("name").GetComponent <Text>();

            int thisday = A3_SevendayModel.getInstance().thisday;
            Dictionary <int, sevendayData> dic = A3_SevendayModel.getInstance().dic_data;

            string txt = dic[nowday].task_award[award_id].task_des;

            btn_txt.text = ContMgr.getCont("a3_sevenday_get1");

            btn.gameObject.SetActive(false);
            btn.interactable = false;
            old_obj.SetActive(false);
            new_obj.SetActive(false);
            over_obj.SetActive(false);

            //des
            switch (dic[nowday].task_award[award_id].task_type)
            {
            //1:消费
            case 1:
            case 2:
            case 3:
            case 4:
            case 5:
            case 6:
            case 7:
            case 9:
            case 10:
            case 11:
            case 12:
            case 13:
            case 14:
            case 15:
            case 16:

                if (dic[nowday].task_award[award_id].task_have >= int.Parse(dic[nowday].task_award[award_id].task_need))
                {
                    name.text = txt + ContMgr.getCont("canover");
                }
                else
                {
                    name.text = txt + "(" + dic[nowday].task_award[award_id].task_have + "/" + dic[nowday].task_award[award_id].task_need + ")";
                }
                break;

            //name.text = txt + "(" + dic[nowday].task_award[award_id].task_have + "/" + dic[nowday].task_award[award_id].task_need + ")";
            //break;
            //8:等级奖励
            case 8:
                name.text = txt /*+ "(" + "当前:" + PlayerModel.getInstance().up_lvl + "转" + PlayerModel.getInstance().lvl + "级" + ")";*/;
                break;
            }
            //可领状态
            switch (dic[nowday].task_award[award_id].task_type)
            {
            case 1:
            case 2:
            case 3:
            case 4:
            case 5:
            case 6:
            case 7:
            case 9:
            case 10:
            case 11:
            case 12:
            case 13:
            case 14:
            case 15:
            case 16:
                //if (nowday<thisday)
                //{
                //    old_obj.SetActive(true);
                //}
                if (nowday == thisday || nowday < thisday)
                {
                    if (dic[nowday].task_award[award_id].state == 0)
                    {
                        btn.gameObject.SetActive(true);
                        btn.interactable = false;
                    }
                    else if (dic[nowday].task_award[award_id].state == 1)
                    {
                        btn.gameObject.SetActive(true);
                        btn.interactable = true;
                        lst_obj[i].transform.SetAsFirstSibling();
                    }
                    else
                    {
                        over_obj.SetActive(true);
                        lst_obj[i].transform.SetAsLastSibling();
                    }
                }
                else
                {
                    new_obj.SetActive(true);
                }

                break;

            case 8:                /*等级是可以领的其他不行*/
                if (nowday <= thisday)
                {
                    if (dic[nowday].task_award[award_id].state == 0)
                    {
                        btn.gameObject.SetActive(true);
                        btn.interactable = false;
                    }
                    else if (dic[nowday].task_award[award_id].state == 1)
                    {
                        btn.gameObject.SetActive(true);
                        btn.interactable = true;
                        lst_obj[i].transform.SetAsFirstSibling();
                    }
                    else
                    {
                        over_obj.SetActive(true);
                        lst_obj[i].transform.SetAsLastSibling();
                    }
                }
                else
                {
                    new_obj.SetActive(true);
                }

                break;
            }
        }
        public void init(Transform trans)
        {
            a3_currentTeamPanel._instance = this;
            this.itemMemberObjList        = new List <a3_currentTeamPanel.ItemMemberObj>();
            this.txtTeambuff = trans.FindChild("right/bottom/teambuff").GetComponent <Text>();
            Transform transform = trans.FindChild("right/main/body/contains");

            this.team_object        = base.transform.FindChild("right/bottom/team_object/Dropdown").gameObject;
            this.team_object_change = this.team_object.GetComponent <Dropdown>();
            this.team_object_change.onValueChanged.AddListener(new UnityAction <int>(this.team_object_dropdownClick));
            for (int i = 0; i < transform.childCount; i++)
            {
                Transform child = transform.GetChild(i);
                a3_currentTeamPanel.ItemMemberObj item = new a3_currentTeamPanel.ItemMemberObj(child);
                this.itemMemberObjList.Add(item);
            }
            this.togInvite = trans.FindChild("right/bottom/togInvite").GetComponent <Toggle>();
            this.togJoin   = trans.FindChild("right/bottom/togJoin").GetComponent <Toggle>();
            this.togInvite.onValueChanged.AddListener(new UnityAction <bool>(this.onTogAgreenAddOtherClick));
            this.togJoin.onValueChanged.AddListener(new UnityAction <bool>(this.onTogAgreeOtherApplyClick));
            this.materialGrey  = Resources.Load <Material>("uifx/uiGray");
            this.carrSpriteDic = new Dictionary <uint, Sprite>();
            for (int j = 0; j < 3; j++)
            {
                bool flag = j == 0;
                if (flag)
                {
                    this.carrSpriteDic.Add(2u, Resources.Load <Sprite>("icon/team/warrior_team"));
                }
                bool flag2 = j == 1;
                if (flag2)
                {
                    this.carrSpriteDic.Add(3u, Resources.Load <Sprite>("icon/team/mage_team"));
                }
                bool flag3 = j == 2;
                if (flag3)
                {
                    this.carrSpriteDic.Add(5u, Resources.Load <Sprite>("icon/team/assassin_team"));
                }
            }
            BaseButton baseButton = new BaseButton(trans.FindChild("right/bottom/btnQuitTeam"), 1, 1);

            baseButton.onClick = new Action <GameObject>(this.onBtnQuitTeamClick);
            BaseProxy <TeamProxy> .getInstance().addEventListener(TeamProxy.EVENT_CREATETEAM, new Action <GameEvent>(this.onCreateTeam));

            BaseProxy <TeamProxy> .getInstance().addEventListener(TeamProxy.EVENT_AFFIRMINVITE, new Action <GameEvent>(this.onAffirminvite));

            BaseProxy <TeamProxy> .getInstance().addEventListener(TeamProxy.EVENT_NEWMEMBERJOIN, new Action <GameEvent>(this.onNewMemberJoin));

            BaseProxy <TeamProxy> .getInstance().addEventListener(TeamProxy.EVENT_KICKOUT, new Action <GameEvent>(this.onNoticeHaveMemberLeave));

            BaseProxy <TeamProxy> .getInstance().addEventListener(TeamProxy.EVENT_CHANGETEAMINFO, new Action <GameEvent>(this.onChangeTeamInfo));

            BaseProxy <TeamProxy> .getInstance().addEventListener(TeamProxy.EVENT_NOTICEHAVEMEMBERLEAVE, new Action <GameEvent>(this.onNoticeHaveMemberLeave));

            BaseProxy <TeamProxy> .getInstance().addEventListener(TeamProxy.EVENT_LEAVETEAM, new Action <GameEvent>(this.onLeaveTeam));

            BaseProxy <TeamProxy> .getInstance().addEventListener(TeamProxy.EVENT_NOTICEONLINESTATECHANGE, new Action <GameEvent>(this.onNoticeOnlineStateChange));

            BaseProxy <TeamProxy> .getInstance().addEventListener(TeamProxy.EVENT_CHANGECAPTAIN, new Action <GameEvent>(this.onChangeCaptain));

            BaseProxy <TeamProxy> .getInstance().addEventListener(TeamProxy.EVENT_TEAMOBJECT_CHANGE, new Action <GameEvent>(this.onChangeTeamObject));

            bool flag4 = BaseProxy <TeamProxy> .getInstance().MyTeamData != null;

            if (flag4)
            {
                this.team_object_change.value = this.change_v((int)BaseProxy <TeamProxy> .getInstance().MyTeamData.ltpid, false);
            }
        }
        public void init(Transform trans)
        {
            _instance = this;
            inText();
            itemMemberObjList = new List <ItemMemberObj>();
            txtTeambuff       = trans.FindChild("right/bottom/teambuff").GetComponent <Text>();
            Transform objects = trans.FindChild("right/main/body/contains");

            team_object        = transform.FindChild("right/bottom/team_object/Dropdown").gameObject;
            team_object_change = team_object.GetComponent <Dropdown>();
            team_object_change.onValueChanged.AddListener(team_object_dropdownClick);


            team_object_change.captionText.text = ContMgr.getCont("a3_teamPanel_16");
            for (int i = 0; i < team_object_change.options.Count; i++)
            {
                team_object_change.options[i].text = ContMgr.getCont("a3_teamPanel_" + (i + 16));
            }

            for (int i = 0; i < objects.childCount; i++)
            {
                Transform     child         = objects.GetChild(i);
                ItemMemberObj itemMemberObj = new ItemMemberObj(child);
                itemMemberObjList.Add(itemMemberObj);
            }
            togInvite = trans.FindChild("right/bottom/togInvite").GetComponent <Toggle>();
            /*暂时先屏蔽掉*/ //togJoin = trans.FindChild("right/bottom/togJoin").GetComponent<Toggle>();
            togInvite.onValueChanged.AddListener(onTogAgreenAddOtherClick);
            //togJoin.onValueChanged.AddListener(onTogAgreeOtherApplyClick);
            materialGrey  = U3DAPI.U3DResLoad <Material>("uifx/uiGray");
            carrSpriteDic = new Dictionary <uint, Sprite>();

            for (int i = 0; i < 3; i++)
            {
                if (i == 0)
                {
                    carrSpriteDic.Add(2, GAMEAPI.ABUI_LoadSprite("icon_team_warrior_team"));
                }
                if (i == 1)
                {
                    carrSpriteDic.Add(3, GAMEAPI.ABUI_LoadSprite("icon_team_mage_team"));
                }
                if (i == 2)
                {
                    carrSpriteDic.Add(5, GAMEAPI.ABUI_LoadSprite("icon_team_assassin_team"));
                }
            }
            BaseButton btnQuitTeam = new BaseButton(trans.FindChild("right/bottom/btnQuitTeam"));

            btnQuitTeam.onClick = onBtnQuitTeamClick;
            TeamProxy.getInstance().addEventListener(TeamProxy.EVENT_CREATETEAM, onCreateTeam);
            TeamProxy.getInstance().addEventListener(TeamProxy.EVENT_AFFIRMINVITE, onAffirminvite);
            TeamProxy.getInstance().addEventListener(TeamProxy.EVENT_NEWMEMBERJOIN, onNewMemberJoin);
            TeamProxy.getInstance().addEventListener(TeamProxy.EVENT_KICKOUT, onNoticeHaveMemberLeave);
            TeamProxy.getInstance().addEventListener(TeamProxy.EVENT_CHANGETEAMINFO, onChangeTeamInfo);
            TeamProxy.getInstance().addEventListener(TeamProxy.EVENT_NOTICEHAVEMEMBERLEAVE, onNoticeHaveMemberLeave);
            TeamProxy.getInstance().addEventListener(TeamProxy.EVENT_LEAVETEAM, onLeaveTeam);
            TeamProxy.getInstance().addEventListener(TeamProxy.EVENT_NOTICEONLINESTATECHANGE, onNoticeOnlineStateChange);
            TeamProxy.getInstance().addEventListener(TeamProxy.EVENT_CHANGECAPTAIN, onChangeCaptain);
            TeamProxy.getInstance().addEventListener(TeamProxy.EVENT_TEAMOBJECT_CHANGE, onChangeTeamObject);
            if (TeamProxy.getInstance().MyTeamData != null)
            {
                team_object_change.value = change_v((int)TeamProxy.getInstance().MyTeamData.ltpid, false);
            }

            new BaseButton(transform.Find("right/main/body/btn_call")).onClick = OnClickMsg;
        }
Example #25
0
 public override void init()
 {
     this.bt         = new BaseButton(base.getTransformByPath("bt"), 1, 1);
     this.bt.onClick = new Action <GameObject>(this.onClick);
     base.init();
 }
Example #26
0
        //刷新充值种类列表
        public void recharge_Refresh()
        {
            if (retra.Count > 0)
            {
                return;
            }
            GameObject    inem = this.transform.FindChild("buy_bg/item").gameObject;
            RectTransform con  = this.transform.FindChild("buy_bg/scrollview/con").GetComponent <RectTransform>();
            Dictionary <int, rechargeData> data = new Dictionary <int, rechargeData> ();

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

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

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

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

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

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

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

            con.sizeDelta = newSize;
        }
Example #27
0
        public override void init()
        {
            getComponentByPath <Text>("btn/doup/Text").text = ContMgr.getCont("a3_ygyiwu_0");
            getComponentByPath <Text>("tab_01/God/help_text/help/descTxt").text = ContMgr.getCont("a3_ygyiwu_1") + "\n" + ContMgr.getCont("a3_ygyiwu_2") + "\n" + ContMgr.getCont("a3_ygyiwu_3");

            instan = this;
            plane  = this.transform.FindChild("tab_01/info").gameObject;
            BaseButton close = new BaseButton(this.transform.FindChild("over"));

            IconHint      = this.transform.FindChild("btn/per_btn/IconHint").gameObject;
            close.onClick = onClose;
            BaseButton God_btn = new BaseButton(this.transform.FindChild("btn/God_btn"));

            God_btn.onClick = (GameObject go) =>
            {
                index = 0;
                ref_topText();
            };
            if (FunctionOpenMgr.instance.Check(FunctionOpenMgr.JL_SL))
            {
                getGameObjectByPath("btn/lockp").SetActive(false);
            }
            else
            {
                getGameObjectByPath("btn/lockp").SetActive(true);
            }
            new BaseButton(getTransformByPath("btn/lockp")).onClick = (GameObject go) =>
            {
                flytxt.instance.fly(ContMgr.getCont("func_limit_44"));
            };
            isthis = this.transform.FindChild("btn/this").gameObject;
            isthis.SetActive(false);
            BaseButton per_btn = new BaseButton(this.transform.FindChild("btn/per_btn"));

            per_btn.onClick = (GameObject go) =>
            {
                index = 1;
                ref_topText();
            };
            BaseButton study_btn = new BaseButton(this.transform.FindChild("tab_02/go"));

            study_btn.onClick = onStudy;

            BaseButton tachback = new BaseButton(this.transform.FindChild("tab_01/info/tach"));
            BaseButton back     = new BaseButton(this.transform.FindChild("tab_01/info/back"));

            new BaseButton(transform.FindChild("tab_01/God/help_God")).onClick = (GameObject go) =>
            {
                transform.FindChild("tab_01/God/help_text").gameObject.SetActive(true);
            };
            new BaseButton(transform.FindChild("tab_01/per/help_Pre")).onClick = (GameObject go) =>
            {
                transform.FindChild("tab_01/per/help_text").gameObject.SetActive(true);
            };

            new BaseButton(transform.FindChild("tab_01/God/help_text/close")).onClick    =
                new BaseButton(transform.FindChild("tab_01/God/help_text/tach")).onClick = (GameObject go) => { transform.FindChild("tab_01/God/help_text").gameObject.SetActive(false); };
            new BaseButton(transform.FindChild("tab_01/per/help_text/close")).onClick    =
                new BaseButton(transform.FindChild("tab_01/per/help_text/tach")).onClick = (GameObject go) => { transform.FindChild("tab_01/per/help_text").gameObject.SetActive(false); };
            back.onClick = tachback.onClick = (GameObject go) =>
            {
                if (index == 0)
                {
                    this.transform.FindChild("tab_01/God").gameObject.SetActive(true);
                }
                else if (index == 1)
                {
                    this.transform.FindChild("tab_01/per").gameObject.SetActive(true);
                }
                this.transform.FindChild("tab_01/info").gameObject.SetActive(false);
                this.transform.FindChild("btn").gameObject.SetActive(true);
            };
            BaseButton do_book = new BaseButton(this.transform.FindChild("btn/doup"));

            do_book.onClick = (GameObject go) =>
            {
                CloseIndex = 1;
                this.transform.FindChild("tab_01").gameObject.SetActive(false);
                this.transform.FindChild("btn").gameObject.SetActive(false);
                this.transform.FindChild("tab_02").gameObject.SetActive(true);
            };
            this.getEventTrigerByPath("tach").onDrag = OnDrag;
            studybar = this.transform.FindChild("tab_02/bar").GetComponent <Image>();
            into_God();
            into_per();
            A3_ygyiwuProxy.getInstance().SendYGinfo(2);
            refreshinfo(null);

            scrollControler = new ScrollControler();
            ScrollRect scroll = transform.FindChild("tab_01/God/view").GetComponent <ScrollRect>();

            scrollControler.create(scroll);

            scrollControler1 = new ScrollControler();
            ScrollRect scroll1 = transform.FindChild("tab_01/per/view").GetComponent <ScrollRect>();

            scrollControler1.create(scroll1);
        }
Example #28
0
        private void OnShowTaskUi()
        {
            bool isComplete = this.curTask.isComplete;

            if (isComplete)
            {
                this.ShowTask();
            }
            else
            {
                this.conIcon.gameObject.SetActive(true);
                this.OnShowAwardInfo();
                bool flag = this.curTask.targetType == TaskTargetType.VISIT;
                if (flag)
                {
                    BaseProxy <A3_TaskProxy> .getInstance().addEventListener(3u, new Action <GameEvent>(this.OnRefreshTask));

                    BaseProxy <A3_TaskProxy> .getInstance().SendTalkWithNpc(dialog.m_npc.id);
                }
                bool flag2 = this.curTask.targetType == TaskTargetType.GETEXP;
                if (flag2)
                {
                    SXML sXML  = XMLMgr.instance.GetSXML("task.Task", "id==" + this.curTask.taskId);
                    int  num   = int.Parse(sXML.getString("trigger"));
                    bool flag3 = num == 2;
                    if (flag3)
                    {
                        this.btnNext.interactable = true;
                        this.btnNext.transform.FindChild("Text").GetComponent <Text>().text = "转生";
                        this.btnNext.onClick = new Action <GameObject>(this.OnOpenZhuan);
                    }
                }
                bool flag4 = this.curTask.targetType == TaskTargetType.GET_ITEM_GIVEN;
                if (flag4)
                {
                    A3_TaskOpt.Instance.taskItemId = (uint)this.curTask.completionAim;
                    this.btnNext.transform.FindChild("Text").GetComponent <Text>().text = "上交物品";
                    BaseButton expr_17B = this.btnNext;
                    expr_17B.onClick = (Action <GameObject>) Delegate.Combine(expr_17B.onClick, new Action <GameObject>(delegate(GameObject go)
                    {
                        int num2          = this.curTask.completion - this.curTask.taskRate;
                        int itemNumByTpid = ModelBase <a3_BagModel> .getInstance().getItemNumByTpid(A3_TaskOpt.Instance.taskItemId);
                        bool flag5        = itemNumByTpid < num2;
                        if (flag5)
                        {
                            InterfaceMgr.getInstance().close(InterfaceMgr.DIALOG);
                            ArrayList arrayList = new ArrayList();
                            arrayList.Add(ModelBase <a3_BagModel> .getInstance().getItemDataById(A3_TaskOpt.Instance.taskItemId));
                            InterfaceMgr.getInstance().open(InterfaceMgr.A3_ITEMLACK, arrayList, false);
                            A3_TaskOpt.Instance.HideSubmitItem();
                        }
                        else
                        {
                            A3_TaskOpt expr_92 = A3_TaskOpt.Instance;
                            if (expr_92 != null)
                            {
                                expr_92.ShowSubmitItem();
                            }
                        }
                    }));
                }
            }
        }
Example #29
0
        public override void init()
        {
            a3_equipsell._instance = this;
            this.scrollControer    = new ScrollControler();
            ScrollRect component = base.transform.FindChild("panel_right/bg/Scroll_rect").GetComponent <ScrollRect>();

            this.scrollControer.create(component, 4);
            this.scrollcontroers = new ScrollControler();
            ScrollRect component2 = base.transform.FindChild("panel_left/bg/Scrollrect").GetComponent <ScrollRect>();

            this.scrollcontroers.create(component2, 4);
            this.contain         = base.transform.FindChild("panel_right/bg/Scroll_rect/contain").gameObject;
            this.grid            = base.transform.FindChild("panel_right/bg/Scroll_rect/grid").gameObject;
            this.contain_left    = base.transform.FindChild("panel_left/bg/Scrollrect/contain").gameObject;
            this.white           = base.getComponentByPath <Toggle>("panel_left/panel/Toggle_white");
            this.mojing          = base.getComponentByPath <Text>("panel_left/panel/mojing/num");
            this.shengguanghuiji = base.getComponentByPath <Text>("panel_left/panel/shenguang/num");
            this.mifageli        = base.getComponentByPath <Text>("panel_left/panel/mifa/num");
            this.prompt          = base.getGameObjectByPath("prompt");
            this.quick_image     = base.getGameObjectByPath("panel_right/bg/Image");
            this.white.onValueChanged.AddListener(delegate(bool ison)
            {
                if (ison)
                {
                    this.EquipsSureSell(0u, 1);
                }
                else
                {
                    this.EquipsNoSell(0u, 1);
                }
            });
            this.green = base.getComponentByPath <Toggle>("panel_left/panel/Toggle_green");
            this.green.onValueChanged.AddListener(delegate(bool ison)
            {
                if (ison)
                {
                    this.EquipsSureSell(0u, 2);
                }
                else
                {
                    this.EquipsNoSell(0u, 2);
                }
            });
            this.blue = base.getComponentByPath <Toggle>("panel_left/panel/Toggle_blue");
            this.blue.onValueChanged.AddListener(delegate(bool ison)
            {
                if (ison)
                {
                    this.EquipsSureSell(0u, 3);
                }
                else
                {
                    this.EquipsNoSell(0u, 3);
                }
            });
            this.purple = base.getComponentByPath <Toggle>("panel_left/panel/Toggle_puple");
            this.purple.onValueChanged.AddListener(delegate(bool ison)
            {
                if (ison)
                {
                    this.EquipsSureSell(0u, 4);
                }
                else
                {
                    this.EquipsNoSell(0u, 4);
                }
            });
            BaseButton baseButton = new BaseButton(base.transform.FindChild("btn_close"), 1, 1);

            baseButton.onClick = new Action <GameObject>(this.onclose);
            BaseButton baseButton2 = new BaseButton(base.transform.FindChild("panel_right/Button"), 1, 1);

            baseButton2.onClick = new Action <GameObject>(this.onQuicklyChoose);
            BaseButton baseButton3 = new BaseButton(base.transform.FindChild("panel_left/Button"), 1, 1);

            baseButton3.onClick = new Action <GameObject>(this.onDecompose);
            BaseButton baseButton4 = new BaseButton(this.prompt.transform.FindChild("Button"), 1, 1);

            baseButton4.onClick = new Action <GameObject>(this.Sendproxy);
            BaseButton baseButton5 = new BaseButton(this.prompt.transform.FindChild("btn_close"), 1, 1);

            baseButton5.onClick = delegate(GameObject go)
            {
                this.prompt.SetActive(false);
            };
        }
        public override void init()
        {
            apModel = AutoPlayModel.getInstance();
            inText();
            nhpText   = getComponentByPath <Text>("nhptxt");
            nhpSlider = getComponentByPath <Slider>("nhpSlider");
            nmpText   = getComponentByPath <Text>("nmptxt");
            nmpSlider = getComponentByPath <Slider>("nmpSlider");
            //mhpText = getComponentByPath<Text>("mhptxt");
            //mhpSlider = getComponentByPath<Slider>("mhpSlider");
            buyToggle = getComponentByPath <Toggle>("buy");

            nhpSlider.onValueChanged.AddListener(OnNhpSliderChange);
            nmpSlider.onValueChanged.AddListener(OnNmpSliderChange);
            //mhpSlider.onValueChanged.AddListener(OnMhpSliderChange);
            buyToggle.onValueChanged.AddListener(OnBuyToggleChange);

            avoidToggle       = getComponentByPath <Toggle>("avoid");
            pkToggle          = getComponentByPath <Toggle>("pk");
            respawnToggle     = getComponentByPath <Toggle>("respawn");
            goldRespawnToggle = getComponentByPath <Toggle>("goldrespawn");
            upboundToggle     = getComponentByPath <Toggle>("upbound");
            timesInputField   = getComponentByPath <InputField>("times");

            avoidToggle.onValueChanged.AddListener(OnAvoidToggleChange);
            pkToggle.onValueChanged.AddListener(OnPkToggleChange);
            respawnToggle.onValueChanged.AddListener(OnRespawnToggleChange);
            goldRespawnToggle.onValueChanged.AddListener(OnGoldRespawnToggleChange);
            upboundToggle.onValueChanged.AddListener(OnUpboundToggleChange);
            timesInputField.onValueChanged.AddListener(OnTimesInputField);

            skillChoosed = new GameObject[4];
            for (int i = 0; i < 4; i++)
            {
                skillChoosed[i] = getGameObjectByPath("skill/" + i);
                skillChoosed[i].transform.FindChild("mask").localPosition = Vector3.zero;
                var evli = EventTriggerListener.Get(skillChoosed[i].gameObject);
                evli.onDown = (GameObject g) => {
                    dragdown = int.Parse(g.name);
                    dragup   = int.Parse(g.name);
                };
                evli.onDrag = (GameObject g, Vector2 d) => {
                    var t = g.transform.FindChild("mask");
                    t.transform.position += new Vector3(d.x, d.y, 0);
                };
                evli.onEnter = (GameObject g) => {
                    dragdown = int.Parse(g.name);
                };
                var cbg       = getTransformByPath("skill/cbg");
                var cornerskk = new Vector3[4];
                if (cbg != null)
                {
                    cbg.GetComponent <RectTransform>().GetWorldCorners(cornerskk);
                }
                evli.onDragEnd = (GameObject g, Vector2 d) => {
                    Vector3 mousePos = Input.mousePosition;
                    if (mousePos.x < cornerskk[0].x ||
                        mousePos.x > cornerskk[2].x ||
                        mousePos.y <cornerskk[0].y ||
                                    mousePos.y> cornerskk[2].y)
                    {
                        dragdown = -1;
                    }

                    if (dragup != dragdown)
                    {
                        if (dragdown == -1)
                        {
                            //丢弃
                            if (openListSkil != null)
                            {
                                openListSkil.transform.FindChild("mask").gameObject.SetActive(false);
                                apModel.Skills[int.Parse(g.name)] = 0;
                                openListSkil = null;
                                skList.parent.gameObject.SetActive(false);
                            }
                        }
                        else
                        {
                            //交换
                        }
                    }
                    var t = g.transform.FindChild("mask");
                    t.transform.localPosition = Vector3.zero;
                };
                evli.onClick = OnSkillChoosedClick;
                // BaseButton btn = new BaseButton(skillChoosed[i].GetComponent<Button>().transform);
                // btn.onClick = OnSkillChoosedClick;
            }
            ;

            /*oriToggle = getComponentByPath<Toggle>("ap_o");
             * mediumToggle = getComponentByPath<Toggle>("ap_m");
             * wholeToggle = getComponentByPath<Toggle>("ap_l");
             * oriToggle.onValueChanged.AddListener(OnOriToggleChange);
             * mediumToggle.onValueChanged.AddListener(OnMediumToggleChange);
             * wholeToggle.onValueChanged.AddListener(OnWholeToggleChange);*/// Modified

            BaseButton closeBtn = new BaseButton(getTransformByPath("closeBtn"));

            closeBtn.onClick = OnClose;

            BaseButton eqpBtn = new BaseButton(getTransformByPath("eqp"));

            eqpBtn.onClick = OnEqp;

            BaseButton pickBtn = new BaseButton(getTransformByPath("pick"));

            pickBtn.onClick = OnPick;

            // BaseButton startBtn = new BaseButton(getTransformByPath("start"));
            //startBtn.onClick = OnStart;

            //BaseButton stopBtn = new BaseButton(getTransformByPath("stop"));
            // stopBtn.onClick = OnStop;
        }