using System; using Godot; using Rokojori.Extensions; namespace Rokojori { [Tool][RokojoriActionCoreExport] public partial class Root:Node { static Root _singleton; public override void _Ready() { _singleton = this; } public static SceneTree Tree() { if ( _singleton == null ) { return null; } return _singleton.GetTree(); } public static Window Window() { var tree = Tree(); if ( tree == null) { return null; } return tree.Root; } static Root GetRoot() { var r = Window(); return _singleton; } } }