继续重构调整(UI)
- 引入 UniTask 和异步版本的 UIModule - 调整 Runtime/UIBase 和 Presentation 下的脚本命名空间到 SepCore.UI - 将原来的 5 层 UI 迁移到异步实现 - 规范各层的 UI 脚本命名
This commit is contained in:
@@ -0,0 +1,37 @@
|
||||
using Cysharp.Threading.Tasks;
|
||||
using SepCore.Definition;
|
||||
using UnityGameFramework.Runtime;
|
||||
|
||||
namespace SepCore.UI
|
||||
{
|
||||
public class HudController : UIControllerBase<HudContext, HudForm>
|
||||
{
|
||||
protected override UIFormType UIFormType => UIFormType.HudForm;
|
||||
|
||||
protected override void RefreshUI(HudForm form, HudContext context)
|
||||
{
|
||||
form.RefreshUI(context);
|
||||
}
|
||||
|
||||
private static HudContext BuildHudContext()
|
||||
{
|
||||
return new HudContext();
|
||||
}
|
||||
|
||||
public override async UniTask<int?> OpenUIAsync(object userData = null, float timeout = 30f)
|
||||
{
|
||||
if (userData != null)
|
||||
{
|
||||
Log.Warning("HudController.OpenUIAsync() userData type is invalid.");
|
||||
return null;
|
||||
}
|
||||
|
||||
return await OpenFormAsync(BuildHudContext(), timeout);
|
||||
}
|
||||
|
||||
public override void BindUseCase(IUIUseCase useCase)
|
||||
{
|
||||
Log.Info("HudFormController doesn't need UseCase");
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user