コード例 #1
0
ファイル: WindowManager.cs プロジェクト: txotxopue/RamasHope
    /// <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));
    }
コード例 #2
0
ファイル: WindowManager.cs プロジェクト: txotxopue/RamasHope
 /// <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;
         }
     }
 }
コード例 #3
0
 public BaseWindow Open(EWindows pWindow)
 {
     return(Open((int)pWindow));
 }
コード例 #4
0
ファイル: WindowManager.cs プロジェクト: txotxopue/RamasHope
 /// <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)));
 }
コード例 #5
0
ファイル: WindowManager.cs プロジェクト: txotxopue/RamasHope
 /// <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);
 }