/// <summary> /// Called when window added to level /// </summary> protected override void OnOpen() { SelectIntentyPropPanel selectPanel = new SelectIntentyPropPanel(transform.Find("tip")); m_intentifyPanel = new IntentifyPanel(transform, selectPanel); m_intentSuccessPanel = new IntentySuccess(transform.Find("success_Panel")); m_intentSuccessPanel.beforePanelVisible = OnSuccessVisibleChangeBefore; m_intentSuccessPanel.afterPanelVisible = OnSuccessVisibleChangeAfter; m_npcMono = GetComponent <NpcMono>("npcInfo"); enableUpdate = true; InitializeText(); }
protected override void OnOpen() { base.OnOpen(); rewardShow = GetComponent <RewardShow> ("topLayer/tips"); summonOnce = GetComponent <Button> ("main/summon_01/summon_Btn"); summonTen = GetComponent <Button> ("main/summon_01/summon_Btn02"); summonOnce2 = GetComponent <Button> ("topLayer/tips/wish_goods/main/summon_01/summon_Btn"); summonTen2 = GetComponent <Button> ("topLayer/tips/wish_goods/main/summon_01/summon_Btn02"); addStoneButton = GetComponent <Button> ("topLayer/stone/add"); confirmButton = GetComponent <Button> ("popup/yes"); costCountText = GetComponent <Text> ("main/summon_01/cost_txt/count"); costCountText2 = GetComponent <Text> ("topLayer/tips/wish_goods/main/summon_01/cost_txt/count"); felling = GetComponent <NpcMono> ("content/npcInfo"); mainContent = GetComponent <Transform> ("main"); npcUIRoot = GetComponent <Transform> ("content/role_render/Root"); stoneCountText = GetComponent <Text> ("topLayer/stone/text"); _petSummonSuccess = GetComponent <PetSummonSSS> ("topLayer/tips/jipin"); scrollView = GetComponent <ScrollView> ("dropInfo/info/inner/items"); dropNode = GetComponent <Transform> ("dropInfo"); maskButton = GetComponent <Button> ("mask"); MultiLanguage(); RefreshCost(); confirmButton?.onClick.AddListener(OnBuyConfirm); summonOnce?.onClick.AddListener(OnSummonOnce); summonTen?.onClick.AddListener(OnSummonTen); summonOnce2?.onClick.AddListener(OnSummonOnce); summonTen2?.onClick.AddListener(OnSummonTen); maskButton?.onClick.AddListener(OnMaskClick); maskButton.SafeSetActive(false); CloseToNpc(true); rewardShow.Regirest(ItemIsPet, _petSummonSuccess); rewardShow.OnClose += OnFocus; rewardShow.onAnimEnd.AddListener(() => { summonOnce2.transform.parent.SafeSetActive(!moduleGuide.inGuideProcess); addStoneButton.transform.parent.SafeSetActive(true); }); rewardShow.SetBinder(new SummonTempleteBind()); addStoneButton.onClick.AddListener(() => { UpdateGemText(1); }); new DataSource <PWishItemDropInfo>(modulePet.dropInfo, scrollView, SetDropItem); }
protected override void InitComponent() { base.InitComponent(); remainCountText = WindowCache.GetComponent <Text>("npc_storypanel/bottom/remainchallengeCount/remainCount_Txt"); nameText = WindowCache.GetComponent <Text>("npc_storypanel/story_panel/title/Text"); descText = WindowCache.GetComponent <Text>("npc_storypanel/story_panel/Text"); fatiguiText = WindowCache.GetComponent <Text>("npc_storypanel/bottom/start_Btn/Text"); npcPointText = WindowCache.GetComponent <Text>("npc_storypanel/story_panel/value/number_text"); npcMono = WindowCache.GetComponent <NpcMono>("npc_storypanel/npcInfo"); resetTimeButton = WindowCache.GetComponent <Button>("npc_storypanel/bottom/remainchallengeCount/resetBtn"); startButton = WindowCache.GetComponent <Button>("npc_storypanel/bottom/start_Btn"); starParent = WindowCache.GetComponent <Transform>("npc_storypanel/story_panel/title/star_parent"); scrollView = WindowCache.GetComponent <ScrollView>("npc_storypanel/story_panel/reward_partent/props"); resetRoot = WindowCache.GetComponent <Transform>("npc_storypanel/bottom/remainchallengeCount"); }
protected override void OnOpen() { //临时关闭图鉴入口2019.1.8 TZJ GetComponent <Transform>("main/top_left/icons/collection").gameObject.SetActive(false); level = Level.current as Level_Home; m_rankActiveRoot = GetComponent <Transform>("fight/rank/bg"); m_rankCountDown = GetComponent <Text>("fight/rank/bg/Text"); m_rankOpenTime = GetComponent <Text>("fight/rank/decription_text"); m_btnWelfare = GetComponent <Button>("main/top_left/icons/welfare"); m_homeIcons[1] = MarkableIcon.Create(1, m_btnWelfare, () => { CanEnterWelfre(); }); m_btnNotice = GetComponent <Button>("main/top_left/icons/announce"); m_homeIcons[3] = MarkableIcon.Create(3, m_btnNotice, ShowWindow <Window_Announcement>); m_btnQuest = GetComponent <Button>("main/top_left/icons/mission"); m_homeIcons[4] = MarkableIcon.Create(4, m_btnQuest, () => { moduleActive.ActiveClick = 0; ShowWindow <Window_Active>(); }); m_btnNote = GetComponent <Button>("main/top_left/icons/note"); m_homeIcons[34] = MarkableIcon.Create(34, m_btnNote, ShowWindow <Window_DatingSelectNpc>); m_btnChat = GetComponent <Button>("main/bottom_left/chat"); m_homeIcons[7] = MarkableIcon.Create(7, m_btnChat, () => { moduleChat.opChatType = OpenWhichChat.WorldChat; ShowWindow <Window_Chat>(); }); m_btnCollection = GetComponent <Button>("main/top_left/icons/collection"); m_homeIcons[33] = MarkableIcon.Create(33, m_btnCollection, ShowWindow <Window_Collection>); m_btnPet = GetComponent <Button>("main/bottom_right/icons/sprite"); m_homeIcons[25] = MarkableIcon.Create(25, m_btnPet, ShowWindow <Window_Sprite>); m_btnRole = GetComponent <Button>("main/bottom_right/icons/attribute"); m_homeIcons[8] = MarkableIcon.Create(8, m_btnRole, ShowWindow <Window_Attribute>); m_btnSkill = GetComponent <Button>("main/bottom_right/icons/skill"); m_homeIcons[27] = MarkableIcon.Create(27, m_btnSkill, ShowWindow <Window_Skill>); m_btnEquipment = GetComponent <Button>("main/bottom_right/icons/bag"); m_homeIcons[9] = MarkableIcon.Create(9, m_btnEquipment, () => { Module_Equip.selectEquipType = EnumSubEquipWindowType.MainPanel; ShowWindow <Window_Equip>(); }); m_btnRune = GetComponent <Button>("main/bottom_right/icons/rune"); m_homeIcons[10] = MarkableIcon.Create(10, m_btnRune, ShowWindow <Window_RuneStart>); m_btnBag = GetComponent <Button>("main/bottom_right/icons/closet"); m_homeIcons[11] = MarkableIcon.Create(11, m_btnBag, () => { moduleCangku.chickType = WareType.Prop; ShowWindow <Window_Cangku>(); }); m_awake = GetComponent <Button>("main/bottom_right/icons/awake"); m_homeIcons[28] = MarkableIcon.Create(28, m_awake, ShowWindow <Window_Awakeinit>); m_btnTakePhoto = GetComponent <Button>("main/bottom_right/shot/go"); m_btnTakePhoto.onClick.AddListener(TakePhoto); m_btnHideBottom = GetComponent <Toggle>("main/bottom_right/home"); m_btnHideBottom.onValueChanged.AddListener(YouAreBeautyBaby); m_btnShop = GetComponent <Button>("main/middle_right/street"); m_homeIcons[12] = MarkableIcon.Create(12, m_btnShop, () => { SwitchTo(CommStreet); }); m_btnDungeon = GetComponent <Button>("main/middle_right/dungeons_btn"); m_homeIcons[13] = MarkableIcon.Create(13, m_btnDungeon, () => { SwitchTo(Dungeon); }); m_btnFight = GetComponent <Button>("main/middle_right/battle"); m_homeIcons[14] = MarkableIcon.Create(14, m_btnFight, () => { SwitchTo(Fight); }); m_btnAttack = GetComponent <Button>("main/middle_right/attack"); m_homeIcons[15] = MarkableIcon.Create(15, m_btnAttack, ShowWindow <Window_Chase>); m_btnUnion = GetComponent <Button>("main/middle_right/union"); m_homeIcons[29] = MarkableIcon.Create(29, m_btnUnion, ShowWindow <Window_Union>); m_btnStreet = GetComponent <Button>("main/middle_right/npcStreet"); m_homeIcons[31] = MarkableIcon.Create(31, m_btnStreet, OnClickDatingStreet); m_train = GetComponent <Button>("fight/train"); m_homeIcons[16] = MarkableIcon.Create(16, m_train, () => { Game.LoadLevel(GeneralConfigInfo.sTrainLevel); }); m_pvp = GetComponent <Button>("fight/match"); m_homeIcons[17] = MarkableIcon.Create(17, m_pvp, () => { modulePVP.Enter(OpenWhichPvP.FreePvP); }); m_match = GetComponent <Button>("fight/rank"); m_homeIcons[18] = MarkableIcon.Create(18, m_match, () => { modulePVP.Enter(OpenWhichPvP.LolPvP); }); m_labyrinth = GetComponent <Button>("dungeons/labyrinth"); m_homeIcons[19] = MarkableIcon.Create(19, m_labyrinth, () => { moduleLabyrinth.SendLabyrinthEnter(); }); m_bordlands = GetComponent <Button>("dungeons/bordlands"); m_homeIcons[20] = MarkableIcon.Create(20, m_bordlands, () => { moduleBordlands.Enter(); }); m_forge = GetComponent <Button>("commercialstreet/forge"); m_homeIcons[21] = MarkableIcon.Create(21, m_forge, () => { moduleForging.ClickType = EquipType.Weapon; ShowWindow <Window_Forging>(); }); m_fashionShop = GetComponent <Button>("commercialstreet/shizhuangdian"); m_homeIcons[22] = MarkableIcon.Create(22, m_fashionShop, ShowWindow <Window_Shizhuangdian>); m_drifterShop = GetComponent <Button>("commercialstreet/liulangshangdian"); m_homeIcons[23] = MarkableIcon.Create(23, m_drifterShop, ShowWindow <Window_Liulangshangdian>); m_wishingWell = GetComponent <Button>("commercialstreet/wish"); m_homeIcons[24] = MarkableIcon.Create(24, m_wishingWell, ShowWindow <Window_Wish>); m_petSummon = GetComponent <Button>("commercialstreet/summon"); m_homeIcons[26] = MarkableIcon.Create(26, m_petSummon, ShowWindow <Window_Summon>); m_factionBattle = GetComponent <Button>("fight/faction"); m_homeIcons[35] = MarkableIcon.Create(35, m_factionBattle, () => { if (moduleFactionBattle.state >= Module_FactionBattle.State.Processing) { ShowWindow <Window_FactionBattle>(); } else { ShowWindow <Window_FactionSign>(); } }); m_pettip = GetComponent <RectTransform>("tips").gameObject; m_canenter = GetComponent <Button>("dungeons/sprite/highlight"); m_canopen = GetComponent <Button>("dungeons/sprite/progress"); m_waite = GetComponent <Button>("dungeons/sprite/countdown"); m_progressvalue = GetComponent <Image>("dungeons/sprite/progress/progressframe_01/progressframe_02"); m_waitprogress = GetComponent <RectTransform>("dungeons/sprite/countdown/countdownframe_img_01").gameObject; m_mazeReadyImg = GetComponent <Image>("dungeons/labyrinth/icon/ready"); m_mazeChallengeImg = GetComponent <Image>("dungeons/labyrinth/icon/chanllenge"); m_mazeRestImg = GetComponent <Image>("dungeons/labyrinth/icon/rest"); m_mazeSettlementImg = GetComponent <Image>("dungeons/labyrinth/icon/settlement"); m_labyrinthCountDown = GetComponent <Text>("dungeons/labyrinth/stateSign_Txt"); #region faction m_factionTint = GetComponent <Transform>("main/middle_right/battle/faction_battle"); m_rankTint = GetComponent <Transform>("main/middle_right/battle/rank_battle"); m_factionLock = GetComponent <Transform>("fight/faction/lock"); m_stateTintRoot = GetComponent <Transform>("fight/faction/bg"); m_stateTint = GetComponent <Text>("fight/faction/bg/Text (1)"); m_factionActiveTime = GetComponent <Text>("fight/faction/bg/Text"); m_factionOpenTime = GetComponent <Text>("fight/faction/Text"); #endregion m_canenter.onClick.AddListener(SetTip); m_waite.onClick.AddListener(() => { moduleGlobal.ShowMessage(ConfigText.GetDefalutString(239, 6)); }); m_canopen.onClick.AddListener(SetTip); m_unionBossBtn = GetComponent <Button>("main/middle_right/union/mark"); m_unionBossBtn.onClick.RemoveAllListeners(); m_unionBossBtn.onClick.AddListener(delegate { moduleUnion.OpenBossWindow = true; ShowWindow <Window_Union>(); }); m_showTypes[0] = new ShowTypeInfo() { o = transform.Find("main").gameObject, handler = UpdateMain }; m_showTypes[1] = new ShowTypeInfo() { o = transform.Find("fight").gameObject, handler = UpdateFight }; m_showTypes[2] = new ShowTypeInfo() { o = transform.Find("dungeons").gameObject, handler = UpdateDungeon }; m_showTypes[3] = new ShowTypeInfo() { o = transform.Find("commercialstreet").gameObject, handler = UpdateCommStreet }; m_showPetToggle = GetComponent <Toggle>("main/bottom_right/showsprite"); m_showPetToggle.isOn = true; m_showPetToggle.onValueChanged.AddListener(b => ToggleShowPet(b, true)); m_combatValue = GetComponent <Text>("main/top_left/icons/combatEffectiveness/value"); m_tweenTLIcons = GetComponent <TweenPosition>("main/top_left/icons"); m_tfEffectNode = GetComponent <RectTransform>("effectnode"); m_tweenDatingNpc = GetComponent <TweenAlpha>("main/content"); m_datingNpcMono = GetComponent <NpcMono>("main/content/npcInfo"); m_banPrefab = GetComponent <RectTransform>("main/banner/templte"); m_banPlane = GetComponent <RectTransform>("main/banner/banScroll"); m_pagePrefab = GetComponent <RectTransform>("main/banner/pageTog"); m_pagePlane = GetComponent <ToggleGroup>("main/banner/pageScroll"); GetChildenObj(); m_tgSwitchDating = GetComponent <Toggle>("main/top_left/lanternTop"); m_tgSwitchDating.isOn = moduleHome.showDatingModel; m_tgSwitchDating.onValueChanged.AddListener(b => SwitchDatingModel(b)); InitializeIcons(); InitializeUnlockText(); MultiLangrage(); }