public void Initialize(Godot.SceneTree tree)
        {
            SceneTree = tree ?? throw new ArgumentNullException(nameof(tree));

            WorldRoot = new Godot.Node2D
            {
                Name = "WorldRoot"
            };
            SceneTree.GetRoot().AddChild(WorldRoot);
        }
Beispiel #2
0
    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);
        }
Beispiel #4
0
 public static Node GetNodeOfType(this SceneTree sceneTree, Type type)
 {
     return(sceneTree.GetRoot().GetChildOfTypeDeep(type));
 }
Beispiel #5
0
 public static IEnumerable <Node> GetNodes(this SceneTree sceneTree)
 {
     return(sceneTree.GetRoot().GetAllChildren());
 }