public void Initialize(Godot.SceneTree tree) { SceneTree = tree ?? throw new ArgumentNullException(nameof(tree)); WorldRoot = new Godot.Node2D { Name = "WorldRoot" }; SceneTree.GetRoot().AddChild(WorldRoot); }
private void deferredGoToScene(string path, string extra) { currentScene.Free(); PackedScene s = (PackedScene)ResourceLoader.Load(path, extra); currentScene = s.Instance(); SceneTree sT = GetTree(); sT.GetRoot().AddChild(currentScene); sT.SetCurrentScene(currentScene); }
public void Initialize(Godot.SceneTree tree) { SceneTree = tree ?? throw new ArgumentNullException(nameof(tree)); BelowWorldScreenSpace = new Godot.CanvasLayer { Name = "ScreenSubWorld", Layer = CanvasLayers.LAYER_SCREEN_BELOW_WORLD }; SceneTree.GetRoot().AddChild(BelowWorldScreenSpace); WorldRoot = new Godot.Node2D { Name = "WorldRoot" }; SceneTree.GetRoot().AddChild(WorldRoot); }
public static Node GetNodeOfType(this SceneTree sceneTree, Type type) { return(sceneTree.GetRoot().GetChildOfTypeDeep(type)); }
public static IEnumerable <Node> GetNodes(this SceneTree sceneTree) { return(sceneTree.GetRoot().GetAllChildren()); }