You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
23 lines
486 B
23 lines
486 B
using Godot;
|
|
|
|
namespace Babushka.scripts.CSharp.Common;
|
|
|
|
public partial class SceneTransition : Node
|
|
{
|
|
[Export] private PackedScene _sceneToLoad;
|
|
[Export] private Node _sceneInstanceParent;
|
|
[Export] private bool _unloadSelf = true;
|
|
|
|
public void LoadScene()
|
|
{
|
|
Node sceneInstance = _sceneToLoad.Instantiate();
|
|
_sceneInstanceParent.AddChild(sceneInstance);
|
|
|
|
if (_unloadSelf)
|
|
{
|
|
QueueFree();
|
|
}
|
|
|
|
}
|
|
|
|
} |