This commit is contained in:
CortexCore
2023-06-19 00:41:44 +08:00
parent 073996ce6c
commit bf122c66dc
48 changed files with 683 additions and 84 deletions

View File

@@ -0,0 +1,50 @@
using Godot;
using System;
namespace BITKit;
public partial class UXPanel : Control, IUXPanel
{
[Export] private bool isAnimate;
[Export] private bool allowCursor;
[Export] private bool allowInput;
[Export] private bool isStartPanel;
public bool IsAnimate => isAnimate;
public string Index => GetType().FullName == typeof(UXPanel).FullName ? Name : GetType().FullName;
public bool AllowCursor => allowCursor;
public bool AllowInput => allowInput;
public virtual void OnEntry(){}
public virtual void Entry()
{
Show();
OnEntry();
}
public virtual void Exit()
{
Hide();
OnExit();
}
public virtual void OnExit(){}
public override void _Ready()
{
UXService.Register(this);
if (isStartPanel)
{
UXService.Open(this as IUXPanel);
}
}
private void Open()
{
UXService.Open(this as IUXPanel);
}
protected override void Dispose(bool disposing)
{
UXService.UnRegister(this);
}
}