43 lines
1.2 KiB
C#
43 lines
1.2 KiB
C#
using System.Collections;
|
|
using System.Collections.Generic;
|
|
using UnityEngine;
|
|
|
|
public class UI
|
|
{
|
|
public static Canvas Canvas => _controller.Canvas;
|
|
|
|
private static WindowsController _controller;
|
|
|
|
public static void Init()
|
|
{
|
|
LoadController();
|
|
}
|
|
|
|
private static void LoadController()
|
|
{
|
|
if (_controller == null)
|
|
_controller = Assets.CreateImmortal<WindowsController>("Main/Windows");
|
|
|
|
_controller.Init();
|
|
}
|
|
|
|
public static IReadOnlyList<Window> GetVisibleStack() => _controller.GetVisibleStack();
|
|
public static void HideVisibleStack() => _controller.HideVisibleStack();
|
|
|
|
public static Coroutine StartCoroutine(IEnumerator coroutine) => _controller.StartCoroutine(coroutine);
|
|
|
|
public static T GetOrCreateWindow<T>() where T : Window
|
|
{
|
|
return _controller.GetOrCreateWindow<T>();
|
|
}
|
|
|
|
public static T ShowWindow<T>() where T : ParameterlessWindow
|
|
{
|
|
return _controller.ShowWindow<T>();
|
|
}
|
|
public static T ShowWindow<T, A1>(A1 a1) where T : ParameterWindow<A1>
|
|
{
|
|
return _controller.ShowWindow<T, A1>(a1);
|
|
}
|
|
|
|
} |