| | |
| | | namespace Snxxz.UI
|
| | | {
|
| | | [XLua.LuaCallCSharp]
|
| | | public class WindowCenter : Singleton<WindowCenter>
|
| | | public class WindowCenter : Singleton<WindowCenter>
|
| | |
|
| | | {
|
| | | public event Action<Window> windowBeforeOpenEvent;
|
| | |
| | | GetWindowInstanceAsync(_name,
|
| | | (bool ok, UnityEngine.Object _object) =>
|
| | | {
|
| | | if (TryGetWindow(out win))
|
| | | if (TryGetWindow(_name, out win))
|
| | | {
|
| | | if (win.windowState == Window.WindowState.Closed)
|
| | | {
|
| | |
| | | Window window = null;
|
| | | if (TryGetWindow(name, out window))
|
| | | {
|
| | | _win = window as T;
|
| | | return true;
|
| | | _win = windows[name] as T;
|
| | | return _win != null;
|
| | | }
|
| | | else
|
| | | {
|
| | |
| | | if (windows.ContainsKey(_name))
|
| | | {
|
| | | _win = windows[_name];
|
| | | return true;
|
| | | return _win != null;
|
| | | }
|
| | | else
|
| | | {
|
| | |
| | | }
|
| | |
|
| | | UILoader.UnLoadWindowAsset(prefabName);
|
| | | instance.name = _name;
|
| | | window = (Window)instance.GetComponent<Window>();
|
| | | window = instance.GetComponent<Window>();
|
| | | var typeName = window.GetType().Name;
|
| | | instance.name = typeName;
|
| | | if (window != null)
|
| | | {
|
| | | windows[_name] = (Window)window;
|
| | | windows[typeName] = window;
|
| | | }
|
| | | else
|
| | | {
|