rj-action-library/Runtime/Godot/Unique.cs

24 lines
381 B
C#
Raw Normal View History

2024-05-04 08:26:16 +00:00
using System.Collections;
using System.Collections.Generic;
using Godot;
namespace Rokojori
{
public class Unique<N> where N:Node
{
private static N _singleton;
public static N Get()
{
if ( _singleton != null )
{
return _singleton;
}
_singleton = Nodes.GetAnyChild<N>( Root.Window() );
return _singleton;
}
}
}