This commit is contained in:
JA
2026-06-20 19:34:23 +08:00
parent e5031c0068
commit d442805c3f
4136 changed files with 514641 additions and 0 deletions

View File

@@ -0,0 +1,40 @@
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
public abstract class UIWindow : MonoBehaviour
{
public delegate void CloseHandler(UIWindow sender, WindowResult result);
public event CloseHandler OnClose;
public GameObject Root;
public virtual System.Type Type { get { return this.GetType(); } }
public enum WindowResult
{
None = 0,
Yes,
NO,
}
public void Close(WindowResult result = WindowResult.None)
{
UIManager.Instance.Close(this.Type);
if (this.OnClose != null)
this.OnClose(this, result);
this.OnClose = null;
}
public virtual void OnCloseClick()
{
this.Close();
}
public virtual void OnYesClick()
{
this.Close(WindowResult.Yes);
}
public virtual void OnNoClick()
{
this.Close(WindowResult.NO);
}
}