public void OnClick(WindowBase window) { var hideCur = this.IsBackActionHide(); var showPrev = this.IsBackActionShowPrevious(); var showSpec = this.IsBackActionShowSpecific(); if (window.GetState() == WindowObjectState.Shown || window.GetState() == WindowObjectState.Showing) { this.onBackAction.Invoke(); if (hideCur == true || showPrev == true || showSpec == true) { if (showPrev == true) { var prev = WindowSystem.GetPreviousWindow(window); if (prev != null) { prev.Show(); } else { #if UNITY_EDITOR || DEBUGBUILD Debug.LogWarning("Previous HistoryItem is null. Make sure your history was not cleared."); #endif } } if (hideCur == true) { window.Hide(); } if (showSpec == true) { WindowSystem.Show(this.window); } } } }
/// <summary> /// Adds to history. /// </summary> /// <param name="window">Window.</param> public static void AddToHistory(WindowBase window) { WindowSystem.AddToHistory(window, window.GetState()); }
public HistoryItem(WindowBase window) { this.state = window.GetState(); this.window = window; }
public HistoryItem(WindowBase window) : this(window, window.GetState()) { }