/// <summary> /// Opens the given window, closes the rest, /// sets the opened window as the current one and returns the window. /// </summary> /// <param name="value">Position of the window to open in the array</param> /// <returns>The opened window</returns> public BaseWindow Open(int value) { if (value < 0 || value >= _windows.Length) { return(null); } _currentWindowID = ListIDToWindow(value); ToggleVisibility(value); return(GetWindow(value)); }
/// <summary> /// Closes the active window(if any). /// </summary> public void Close() { if (_currentWindowID != EWindows.None) { BaseWindow window = GetWindow(WindowToListID(_currentWindowID)); if (window != null && window.gameObject.activeSelf) { window.Close(); _currentWindowID = EWindows.None; } } }
public BaseWindow Open(EWindows pWindow) { return(Open((int)pWindow)); }
/// <summary> /// Opens the given window, closes the rest, /// sets the opened window as the current one and returns the window. /// </summary> /// <param name="pWindow">Window enum value of the window to open</param> /// <returns>The window opened</returns> public BaseWindow Open(EWindows pWindow) { return(Open(WindowToListID(pWindow))); }
/// <summary> /// Translates the Windows Enum value /// to the index of the Window List. /// </summary> /// <param name="pWindow">Windows Enum value of the window</param> /// <returns>int index of the window list</returns> private int WindowToListID(EWindows pWindow) { return((int)pWindow - 1); }