Added indoor ending

This commit is contained in:
2025-06-15 20:05:53 +02:00
committed by cblech
parent 2226b859df
commit 0ebd0c46a0
6 changed files with 63 additions and 11 deletions
+12 -2
View File
@@ -5,13 +5,18 @@ namespace Babushka.scripts.CSharp.Common;
public partial class SceneTransition : Node
{
[Export] private PackedScene _sceneToLoad;
[Export] private Node _sceneInstanceParent;
[Export] private Node? _sceneInstanceParent;
[Export] private bool _unloadSelf = true;
public void LoadScene()
{
Node sceneInstance = _sceneToLoad.Instantiate();
_sceneInstanceParent.AddChild(sceneInstance);
if(_sceneInstanceParent != null)
_sceneInstanceParent.AddChild(sceneInstance);
else
{
GetTree().Root.AddChild(sceneInstance);
}
if (_unloadSelf)
{
@@ -19,4 +24,9 @@ public partial class SceneTransition : Node
}
}
public void Quit()
{
GetTree().Quit();
}
}