add: Scene

This commit is contained in:
h z
2025-02-05 15:01:43 +00:00
parent 3b62b0a348
commit c47c2088cf
6 changed files with 66 additions and 0 deletions

19
src/Scenes/RootScene.cs Normal file
View File

@@ -0,0 +1,19 @@
using Godot;
namespace Hangman.SDK.Scenes;
public abstract partial class RootScene : Node2D
{
private Scene CurrentScene { get; set; }
public void SwitchScene(Scene scene)
{
if (CurrentScene != null)
RemoveChild(CurrentScene);
AddChild(scene);
CurrentScene = scene;
}
}