This commit is contained in:
CortexCore
2025-07-11 11:45:45 +08:00
parent fc189b98cc
commit ecae0f809c
76 changed files with 237471 additions and 33136 deletions

View File

@@ -10,6 +10,7 @@ namespace BITKit.UX
{
public class UXRadialMenu : UIToolKitPanel,IUXHotKey
{
private static UXRadialMenu _singleton;
protected override string DocumentPath => "ui_radial_menu";
public override bool CloseWhenClickOutside => true;
public override bool AllowCursor => true;
@@ -27,6 +28,13 @@ namespace BITKit.UX
public UXRadialMenu(IUXService uxService) : base(uxService)
{
OnInitiatedAsync += InitiatedAsync;
if (_singleton is not null)
{
throw new InvalidOperationException($"{nameof(UXRadialMenu)} only can be one singleton");
}
_singleton = this;
}
private async UniTask InitiatedAsync()
@@ -131,6 +139,13 @@ var button = container.Get<Button>();
}
UXService.Entry(this);
}
public override void Dispose()
{
base.Dispose();
_singleton = null;
}
}
}