52 lines
1.4 KiB
C#
52 lines
1.4 KiB
C#
using System.Collections;
|
|
using System.Collections.Generic;
|
|
using UnityEngine;
|
|
|
|
namespace RND
|
|
{
|
|
|
|
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 GetOrCreate<T>() where T : Window
|
|
{
|
|
return _controller.GetOrCreateWindow<T>();
|
|
}
|
|
|
|
public static T Show<T>() where T : ParameterlessWindow
|
|
{
|
|
return _controller.ShowWindow<T>();
|
|
}
|
|
|
|
public static T Show<T, A1>(A1 a1) where T : ParameterWindow<A1>
|
|
{
|
|
return _controller.ShowWindow<T, A1>(a1);
|
|
}
|
|
|
|
public static void Close<T>() where T : Window
|
|
{
|
|
_controller.CloseWindow<T>();
|
|
}
|
|
}
|
|
} |