using System.Collections; using System.Collections.Generic; using Godot; namespace Rokojori { public class Unique where N:Node { private static N _singleton; public static N Get( Node n = null ) { if ( _singleton != null ) { return _singleton; } var rootWindow = n == null ? Root.Window() : n.Owner; // RJLog.Log( "ROOT", rootWindow ); if ( rootWindow == null ) { return null; } _singleton = Nodes.GetAnyChild( rootWindow ); // RJLog.Log( "_singleton", _singleton ); return _singleton; } } }