refactor: implement singleton pattern for key managers and improve resource access
This commit is contained in:
@@ -4,7 +4,19 @@ namespace Mr.BrickAdventures.Autoloads;
|
||||
|
||||
public partial class UIManager : Node
|
||||
{
|
||||
public static UIManager Instance { get; private set; }
|
||||
|
||||
private readonly System.Collections.Generic.List<Control> UiStack = new();
|
||||
|
||||
public override void _Ready()
|
||||
{
|
||||
Instance = this;
|
||||
}
|
||||
|
||||
public override void _ExitTree()
|
||||
{
|
||||
if (Instance == this) Instance = null;
|
||||
}
|
||||
|
||||
[Signal] public delegate void ScreenPushedEventHandler(Control screen);
|
||||
[Signal] public delegate void ScreenPoppedEventHandler(Control screen);
|
||||
|
||||
Reference in New Issue
Block a user