public void Start() { m_levelHome = Level.current as Level_Home; m_tfRedDot = transform.Find("redDot"); }
private void Start() { m_levelHome = Level.current as Level_Home; m_childs = GetComponentsInChildren <Transform>(); Init(); }
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(); }
private DatingSceneConfig m_curOpenSceneData;//当前打开的场景二级界面数据 #endregion #region Override method protected override void OnOpen() { m_levelHome = Level.current as Level_Home; //约会NPC头像 m_NpcAvatar = GetComponent <Image>("avatar"); //任务列表面板 taskItemScrollView = GetComponent <ScrollView>("panel_task/taskItemScrollView"); m_taskInfoDataSource = new DataSource <Task>(null, taskItemScrollView, SetTaskItemData, ClickTaskItem); m_tfPanelTask = GetComponent <RectTransform>("panel_task"); m_btnTaskPanel = GetComponent <Button>("task_btn"); m_btnTaskPanel.onClick.AddListener(OnClickTaskPanel); m_btnCloseTaskPanel = GetComponent <Button>("panel_task/btnClose"); m_btnCloseTaskPanel.onClick.AddListener(() => m_tfPanelTask.SafeSetActive(false)); m_textTaskName = GetComponent <Text>("panel_task/taskName"); m_textTaskDesc = GetComponent <Text>("panel_task/taskDesc"); m_textTaskTip = GetComponent <Text>("panel_task/taskTip"); m_togMissionGroup = GetComponent <ToggleGroup>("panel_task/taskItemScrollView"); //任务提示面板 m_tfMissionTipPanel = GetComponent <RectTransform>("taskTipPanel"); m_svMissionReceive = GetComponent <ScrollView>("taskTipPanel/scrollViewReceive"); m_dsMissionReceive = new DataSource <Task>(null, m_svMissionReceive, OnSetMissionReceiveData, null); m_svMissionFinished = GetComponent <ScrollView>("taskTipPanel/scrollViewFinished"); m_dsMissionFinished = new DataSource <Task>(null, m_svMissionFinished, OnSetMissionFinishedData, null); //好感度提升提示 m_tfGoodFeelingUpTip = GetComponent <RectTransform>("goodFeelingUpPanel"); //NPC属性 m_tfPMoodLevel = GetComponent <RectTransform>("moodProgressBar/levelInfo"); m_rtfNpcMoodProgress = GetComponent <RectTransform>("moodProgressBar/Fill"); m_rtfMoodSliderBg = GetComponent <RectTransform>("moodProgressBar/bg"); m_textNpcPower = GetComponent <Text>("energy/energyNumber"); m_imgNpcPowerProgress = GetComponent <Image>("energy/energyFill"); //对话回顾 m_btnRecordDialogue = GetComponent <Button>("history_btn"); m_btnRecordDialogue.onClick.AddListener(() => moduleNPCDating.OpenReviewWindow()); //打开场景二级界面 m_tfSecondScenePanel = GetComponent <RectTransform>("sceneContent"); m_tfSceneOpenEvent = GetComponent <RectTransform>("sceneContent/dailyEvent/dailyEventGroup"); m_btnCloseScenePanel = GetComponent <Button>("sceneContent/closeBtn"); m_btnCloseScenePanel.onClick.AddListener(OnClickCloseScenePanel); m_btnEnterScene = GetComponent <Button>("sceneContent/confirmBtn"); m_btnEnterScene.onClick.AddListener(OnClickEnterScene); m_tfSceneImage = GetComponent <RectTransform>("sceneContent/back/map"); m_textSceneName = GetComponent <Text>("sceneContent/title"); m_textSceneOpenTime = GetComponent <Text>("sceneContent/serviceTime/Text"); m_textSceneDesc = GetComponent <Text>("sceneContent/content"); m_textConsumePower = GetComponent <Text>("sceneContent/consume/content"); m_tfSceneBottomImage = GetComponent <RectTransform>("sceneContent/decBottom"); m_imgSceneTopImage = GetComponent <Image>("sceneContent/decTop"); //随机独白 m_tfRandomDialogue = GetComponent <RectTransform>("randomDialogue"); //控制UI组件显隐的动画组件 m_taShowUI = GetComponent <TweenAlpha>("uiTweenAlpha"); //主界面滑动 m_srMap = GetComponent <ScrollRect>("DatingMapScroll"); m_srMap.onValueChanged.AddListener(OnScrollRectValueChanged); var srMapTrigger = m_srMap.GetComponentDefault <EventTriggerListener>(); srMapTrigger.onDown += OnScrollRectDown; srMapTrigger.onUp += OnScrollRectUp; srMapTrigger.onPressBegin += OnScrollRectBeginDrag; srMapTrigger.onPressEnd += OnScrollRectEndDrag; //任务推荐 m_btnTaskRecommend = GetComponent <Button>("missionTip"); m_btnTaskRecommend.onClick.AddListener(OnClickTaskPanel); m_imgTaskRecommendIcon = GetComponent <Image>("missionTip/missionIcon"); m_txtTaskRecommendName = GetComponent <Text>("missionTip/missionTitle"); //游玩指南 m_textGuideContent = GetComponent <Text>("tip_notice/viewport/content"); m_aspect = UIManager.instance._canvasScaler.referenceResolution.x / UIManager.referenceResolution.x; m_datingCamLeftPos = GeneralConfigInfo.sdatingMapCamera.leftPos; m_datingCamRightPos = GeneralConfigInfo.sdatingMapCamera.rightPos; m_datingMaxCamLeftPos = GeneralConfigInfo.sdatingMapCamera.maxLeftPos; m_datingMaxCamRightPos = GeneralConfigInfo.sdatingMapCamera.maxRightPos; InitText(); }