1
This commit is contained in:
@@ -19,10 +19,6 @@ namespace BITKit.UX
|
||||
/// </summary>
|
||||
bool IsWindow { get; }
|
||||
/// <summary>
|
||||
/// 该面板是否有效,用于检查该面板是否已经被销毁
|
||||
/// </summary>
|
||||
//bool IsValid { get; }
|
||||
/// <summary>
|
||||
/// 该面板的索引(入口,Key)
|
||||
/// </summary>
|
||||
string Index { get; }
|
||||
@@ -38,77 +34,15 @@ namespace BITKit.UX
|
||||
/// 事件回调,当面板被打开时触发
|
||||
/// </summary>
|
||||
event Action OnEntry;
|
||||
event Func<UniTask> OnEntryAsync;
|
||||
event Action OnEntryCompleted;
|
||||
/// <summary>
|
||||
/// 事件回调,当面板被关闭时触发
|
||||
/// </summary>
|
||||
event Action OnExit;
|
||||
|
||||
void OnUpdate(float deltaTime);
|
||||
}
|
||||
public abstract class UXPanelImplement:IUXPanel
|
||||
{
|
||||
protected abstract IUXPanel service { get; }
|
||||
private IUXPanel _iuxPanelImplementation => service;
|
||||
public bool IsWindow=>_iuxPanelImplementation.IsWindow;
|
||||
//public bool IsValid => _iuxPanelImplementation.IsValid;
|
||||
|
||||
public string Index => _iuxPanelImplementation.Index;
|
||||
|
||||
public bool AllowCursor => _iuxPanelImplementation.AllowCursor;
|
||||
|
||||
public bool AllowInput => _iuxPanelImplementation.AllowInput;
|
||||
|
||||
public bool IsEntered
|
||||
{
|
||||
get => service.IsEntered;
|
||||
set => service.IsEntered = value;
|
||||
}
|
||||
|
||||
public void Entry()
|
||||
{
|
||||
_iuxPanelImplementation.Entry();
|
||||
}
|
||||
|
||||
public UniTask EntryAsync()
|
||||
{
|
||||
return service.EntryAsync();
|
||||
}
|
||||
|
||||
public void Entered()
|
||||
{
|
||||
service.Entered();
|
||||
}
|
||||
|
||||
public void Exit()
|
||||
{
|
||||
_iuxPanelImplementation.Exit();
|
||||
}
|
||||
|
||||
public UniTask ExitAsync()
|
||||
{
|
||||
return service.ExitAsync();
|
||||
}
|
||||
|
||||
public void Exited()
|
||||
{
|
||||
service.Exited();
|
||||
}
|
||||
|
||||
public event Action OnEntry
|
||||
{
|
||||
add => _iuxPanelImplementation.OnEntry += value;
|
||||
remove => _iuxPanelImplementation.OnEntry -= value;
|
||||
}
|
||||
|
||||
public event Action OnExit
|
||||
{
|
||||
add => _iuxPanelImplementation.OnExit += value;
|
||||
remove => _iuxPanelImplementation.OnExit -= value;
|
||||
}
|
||||
|
||||
public void OnUpdate(float deltaTime)
|
||||
{
|
||||
service.OnUpdate(deltaTime);
|
||||
}
|
||||
event Func<UniTask> OnExitAsync;
|
||||
event Action OnExitCompleted;
|
||||
void OnTick(float deltaTime);
|
||||
}
|
||||
}
|
||||
|
@@ -1,10 +1,19 @@
|
||||
using System;
|
||||
using Cysharp.Threading.Tasks;
|
||||
|
||||
namespace BITKit.UX
|
||||
{
|
||||
/// <summary>
|
||||
/// 基本UX服务(GUI管理器),主要通过加载叠加面板实现
|
||||
/// </summary>
|
||||
public interface IUXService
|
||||
public interface IUXService:IDisposable
|
||||
{
|
||||
object Root { get; }
|
||||
/// <summary>
|
||||
/// 初始化
|
||||
/// </summary>
|
||||
/// <returns></returns>
|
||||
UniTask InitializeAsync();
|
||||
/// <summary>
|
||||
/// 注册面板,加入注册队列
|
||||
/// </summary>
|
||||
|
@@ -8,7 +8,11 @@ namespace BITKit.UX
|
||||
{
|
||||
string Message { get; set; }
|
||||
object Container { get; }
|
||||
public void SetMessage(string message)=>Message=message;
|
||||
public IUXWaitingHandle SetMessage(string message)
|
||||
{
|
||||
Message=message;
|
||||
return this;
|
||||
}
|
||||
}
|
||||
public interface IUXWaiting
|
||||
{
|
||||
|
Reference in New Issue
Block a user