Exemplo n.º 1
0
        /*锁,隐藏时装,隐藏飞翼按钮刷新*/
        void refreshObj()
        {
            Dictionary <int, uint> dic = A3_FashionShowModel.getInstance().dic_have_fs;

            foreach (int id in dic_objs.Keys)
            {
                if (dic.ContainsKey(id))
                {
                    dic_objs[id].transform.FindChild("lock").gameObject.SetActive(false);
                }
                else
                {
                    dic_objs[id].transform.FindChild("lock").gameObject.SetActive(true);
                }
            }


            bool show = A3_FashionShowModel.getInstance().dress_show;

            getComponentByPath <Toggle>("right_bg/down/shizhuang").isOn = !show;


            if (FunctionOpenMgr.instance.Check(FunctionOpenMgr.PET_SWING))
            {
                bool showwind = A3_WingModel.getInstance()?.ShowStage > 0 ? false : true;
                getComponentByPath <Toggle>("right_bg/down/feiyi").isOn = showwind;
            }
        }
Exemplo n.º 2
0
        private void OnEquWing(GameObject go)
        {
            A3_WingModel wModel = A3_WingModel.getInstance();

            //TODO 装备/卸下翅膀
            if (wModel.ShowStage > 0)
            {
                if (wingAvatar != null)
                {
                    if (wingAvatar.transform.FindChild("model/Plus_B").transform.childCount > 0)
                    {
                        GameObject.Destroy(wingAvatar.transform.FindChild("model/Plus_B").transform.GetChild(0).gameObject);
                    }
                }
                A3_WingProxy.getInstance().SendShowStage(0);
                wModel.LastShowState = wModel.ShowStage;
                go.transform.FindChild("Text").GetComponent <Text>().text = ContMgr.getCont("a3_wing_skin_show");
            }
            else
            {
                changeWing(wModel.LastShowState);
                A3_WingProxy.getInstance().SendShowStage(wModel.LastShowState);
                go.transform.FindChild("Text").GetComponent <Text>().text = ContMgr.getCont("a3_wing_skin_close");
            }
        }
Exemplo n.º 3
0
        public void OnWings(Variant data)
        {
            debug.Log("wing::" + data.dump());
            int res = data["res"];

            switch (res)
            {
            case 1:    //获得翅膀信息
                A3_WingModel.getInstance().InitWingInfo(data);
                break;

            case 2:    //获得升级强化结果
                A3_WingModel.getInstance().SetLevelExp(data);
                dispatchEvent(GameEvent.Create(ON_LEVEL_EXP_CHANGE, this, data));
                break;

            case 3:    //获得进阶结果
                A3_WingModel.getInstance().SetStageInfo(data);
                if (A3_WingModel.getInstance().stageUp)
                {
                    dispatchEvent(GameEvent.Create(ON_STAGE_CHANGE, this, data));
                    A3_WingModel.getInstance().SetShowStage(data);
                    dispatchEvent(GameEvent.Create(ON_SHOW_CHANGE, this, data));
                }
                else
                {
                    dispatchEvent(GameEvent.Create(ON_STAGE_DIFT, this, data));
                }
                break;

            case 4:     //获得自动升级结果
                A3_WingModel.getInstance().SetLevelExp(data);
                dispatchEvent(GameEvent.Create(ON_LEVEL_AUTO_UPGRADE, this, data));

                break;

            case 5:
                A3_WingModel.getInstance().SetShowStage(data);
                dispatchEvent(GameEvent.Create(ON_SHOW_CHANGE, this, data));
                break;

            default:
                Globle.err_output(res);
                break;
            }
        }
Exemplo n.º 4
0
 //切换翅膀icon背景, 表示当前已选着
 public void OnSetIconBGImage(int showStage)
 {
     foreach (int key in dicIcon.Keys)
     {
         Transform iconBg = dicIcon[key].transform.FindChild("icon_bg");
         if (key == showStage)
         {
             if (A3_WingModel.getInstance().Stage >= showStage)
             {
                 iconBg.GetChild(0).gameObject.SetActive(false);
                 iconBg.GetChild(1).gameObject.SetActive(true);
                 iconBg.GetChild(2).gameObject.SetActive(false);
             }
         }
         else
         {
             iconBg.GetChild(0).gameObject.SetActive(true);
             iconBg.GetChild(1).gameObject.SetActive(false);
             iconBg.GetChild(2).gameObject.SetActive(false);
         }
     }
 }
Exemplo n.º 5
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
        }
Exemplo n.º 6
0
        public bool CheckUpItem()
        {
            if (PlayerModel.getInstance().inFb)
            {
                return(false);
            }
            // 检查加点
            if (PlayerModel.getInstance().up_lvl > 0)
            {
                Btn_RefreshOrCreate(PlayerModel.getInstance()?.pt_att > 0, Title_BtnStronger.Player_Attribute);
            }
            // 检查装备强化
            EquipStrengthOption availableOptions = a3_EquipModel.getInstance().CheckEquipStrengthAvailable()[true];

            if (FunctionOpenMgr.instance.Check(FunctionOpenMgr.EQP_ENCHANT))
            {
                Btn_RefreshOrCreate((availableOptions & EquipStrengthOption.Add) != 0x00, Title_BtnStronger.Equipment_Add);
            }
            if (FunctionOpenMgr.instance.Check(FunctionOpenMgr.EQP_MOUNTING))
            {
                Btn_RefreshOrCreate((availableOptions & EquipStrengthOption.Gem) != 0x00, Title_BtnStronger.Equipment_Gem);
            }
            if (FunctionOpenMgr.instance.Check(FunctionOpenMgr.EQP_ENHANCEMENT))
            {
                Btn_RefreshOrCreate((availableOptions & EquipStrengthOption.Intensify) != 0x00, Title_BtnStronger.Equipment_Intensify);
            }
            //Btn_RefreshOrCreate((availableOptions & EquipStrengthOption.Stage) != 0x00, Title_BtnStronger.Equipment_Stageup);
            // 检查飞翼
            if (FunctionOpenMgr.instance.Check(FunctionOpenMgr.PET_SWING))
            {
                Btn_RefreshOrCreate(A3_WingModel.getInstance()?.CheckLevelupAvailable() ?? false, Title_BtnStronger.Wings);
            }
            // 检查宠物
            //if (FunctionOpenMgr.instance.Check(FunctionOpenMgr.PET))
            //    Btn_RefreshOrCreate(A3_PetModel.getInstance()?.CheckLevelupAvaiable() ?? false, Title_BtnStronger.Pet);
            // 检查护盾
            //Btn_RefreshOrCreate(HudunModel.getInstance().CheckLevelupAvailable(), Title_BtnStronger.Shield);
            // 检查技能
            if (FunctionOpenMgr.instance.Check(FunctionOpenMgr.SKILL))
            {
                Btn_RefreshOrCreate(Skill_a3Model.getInstance()?.CheckSkillLevelupAvailable() ?? false, Title_BtnStronger.Skill_LevelUp);
            }
            // 检查符文

            // 检查军衔
            if (FunctionOpenMgr.instance.Check(FunctionOpenMgr.ACHIEVEMENT))
            {
                Btn_RefreshOrCreate(a3_RankModel.getInstance()?.CheckTitleLevelupAvailable() ?? false, Title_BtnStronger.Title);
            }
            RefreshView();
            if (ShownItemNum > 0)
            {
                upBtn?.gameObject.SetActive(true);
                if (!gameObject.activeSelf)
                {
                    gameObject.SetActive(true);
                }
                return(true);
            }
            else
            {
                upBtn?.gameObject.SetActive(false);
                if (gameObject.activeSelf)
                {
                    gameObject.SetActive(false);
                }
                return(false);
            }
        }