using System.Collections;
using System.Collections.Generic;
using UnityEngine;
using UnityEngine.UI;
namespace SoftKitty.InventoryEngine
{
public class WindowsManager : MonoBehaviour
{
///
/// Returns true if there is any UI window exists.
///
public static bool anyWindowExists
{
get
{
return windowsDic.Keys.Count > 0;
}
}
#region Variables
public static UiWindow ActiveWindow;
private static WindowsManager instance;
private static Dictionary windowsDic = new Dictionary();
#endregion
#region Internal Methods
void Awake()
{
instance = this;
windowsDic.Clear();
}
IEnumerator ActiveWindowLater(UiWindow _window)
{
yield return 1;
_window.ActiveWindow();
}
public static GameObject GetMainCanvas(GameObject _base=null)
{
if (ItemManager.instance.CanvasTag.Replace(" ", "").Length > 0)
{
Canvas[] _canvas = FindObjectsByType