cool
This commit is contained in:
@@ -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;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user