public override void OnHide() { State.GetAction(UIAction.StarArea_Leap).Callback -= OnLeap; State.GetAction(UIAction.StarArea_TrackMission).Callback -= OnTrackMission; State.GetAction(UIAction.StarArea_TipsToggle).Callback -= OnToggleTips; State.GetAction(UIAction.StarArea_ToPlant).Callback -= OnEsc; State.GetAction(UIAction.StarArea_Legend).Callback -= OnTab; OwnerView.DeleteHotKey(HotKeyID.StarmapOpen); m_Scroller.onValueChanged.RemoveAllListeners(); InputManager.Instance.OnInputDeviceChanged -= OnInputDeviceChanged; m_Starmap3DViewer.SetModel(null); m_StarAreaPanelLeftTips.OnHide(); GameObject.Destroy(m_StarAreaPanelLeftTips); m_CurrentCell = null; foreach (KeyValuePair <ulong, StarAreaElement> item in m_PointDic) { UIEventListener.UIEventListener.AttachListener(item.Value.gameObject).onEnter = null; item.Value.Destroy(); item.Value.Recycle(); item.Value.gameObject.Recycle(); } m_PointDic.Clear(); while (m_Lines.Count > 0) { m_Lines[0].gameObject.Recycle(); m_Lines.RemoveAt(0); } m_Lines.Clear(); base.OnHide(); }
public override void InstallHotkey() { base.InstallHotkey(); OwnerView.DeleteHotKey("NavLeft"); OwnerView.DeleteHotKey("NavRight"); OwnerView.AddHotKey("NavLeft", HotKeyID.NavLeft, OnQCallback); OwnerView.AddHotKey("NavRight", HotKeyID.NavRight, OnECallback); }
/// <summary> /// 删除所有热键 /// </summary> private void RemoveAllHotkeyElement() { if (OwnerView != null) { foreach (string id in m_HotKeyIDs) { OwnerView.SetHotKeyEnabled(id, false); OwnerView.DeleteHotKey(id); } } m_HotKeyIDs.Clear(); }
public override void OnHide() { State.GetAction(UIAction.Common_Select).Callback -= OnSelect; State.GetAction(UIAction.Common_Back).Callback -= OnCloseClick; OwnerView.DeleteHotKey(HotKeyID.StarmapOpen); InputManager.Instance.OnInputDeviceChanged -= OnInputDeviceChanged; foreach (KeyValuePair <int, StarGalaxyElement> item in m_PointDic) { item.Value.Destroy(); item.Value.Recycle(); item.Value.gameObject.Recycle(); } m_PointDic.Clear(); base.OnHide(); }
public override void OnHide() { State.GetAction(UIAction.Common_Select).Callback -= OnSelect; State.GetAction(UIAction.StarPlant_ToGalaxy).Callback -= OnEsc; //State.GetAction(UIAction.StarMap_Close).Callback -= OnCloseClick; OwnerView.DeleteHotKey(HotKeyID.StarmapOpen); m_Tweener = null; foreach (KeyValuePair <uint, StarPlantElement> item in m_PointDic) { item.Value.Destroy(); item.Value.Recycle(); item.Value.gameObject.Recycle(); } m_PointDic.Clear(); base.OnHide(); }
/// <summary> /// 部件卸载时 /// </summary> protected override void OnViewPartUnload() { State.OnPageIndexChanged -= OnPageChanged; State.OnSortIndexChanged -= OnSortChanged; State.OnCategoryIndexChanged -= OnFilterChanged; State.OnLayoutStyleChanged -= OnLayoutStyleChanged; State.OnCompareModeChanged -= OnCompareModeChanged; State.GetAction(UIAction.Common_Sort).Callback -= OnSortKeyPress; State.GetAction(UIAction.Common_Grid_List).Callback -= OnToggleGridLayout; OwnerView.DeleteHotKey("LayoutMode"); OwnerView.DeleteHotKey("CompareMode"); m_Camera = null; if (m_Scroller) { m_Scroller.vertical = true; m_Scroller.ClearData(); m_Scroller.DataSorter = null; m_Scroller.OnHeadRenderer = null; m_Scroller.OnCellRenderer = null; m_Scroller.OnCellPlaceholderRenderer = null; m_Scroller.OnNavigateCallback = null; m_Scroller.OnClickCallback = null; m_Scroller.OnDoubleClickCallback = null; m_Scroller.OnSelectionChanged -= null; m_Scroller.SetTemplateFactory(null); m_Scroller = null; } if (m_ScrollerController) { m_ScrollerController.SetFocused(false); m_ScrollerController = null; } m_ScrollerAnimator = null; m_ScrollerRectTransform = null; LeftLabel = null; m_SortLabel = null; }
/// <summary> /// 安装热键 /// </summary> public virtual void InstallHotkey() { if (!GetTransform()) { return; } OwnerView.DeleteHotKey("NavNegative"); OwnerView.DeleteHotKey("NavPositive"); //Q键 Transform hotkeyQ = FindComponent <Transform>("Content/LImage"); if (hotkeyQ) { OwnerView.AddHotKey("NavNegative", HotKeyID.NavNegative, OnQCallback, hotkeyQ, null, HotkeyManager.HotkeyStyle.UI_SIMPLE); } //E键 Transform hotkeyE = FindComponent <Transform>("Content/RImage"); if (hotkeyE) { OwnerView.AddHotKey("NavPositive", HotKeyID.NavPositive, OnECallback, hotkeyE, null, HotkeyManager.HotkeyStyle.UI_SIMPLE); } }