2025-01-08 18:46:17 +00:00
|
|
|
using System.Collections;
|
|
|
|
|
using System.Collections.Generic;
|
|
|
|
|
|
|
|
|
|
using Godot;
|
|
|
|
|
|
2026-05-22 12:25:02 +00:00
|
|
|
using Rokojori.Extensions;
|
2025-01-08 18:46:17 +00:00
|
|
|
namespace Rokojori
|
|
|
|
|
{
|
|
|
|
|
public class Singleton<T> where T:new()
|
|
|
|
|
{
|
|
|
|
|
private static T _singleton;
|
|
|
|
|
|
|
|
|
|
public static T Get()
|
|
|
|
|
{
|
|
|
|
|
if ( _singleton != null )
|
|
|
|
|
{
|
|
|
|
|
return _singleton;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
_singleton = new T();
|
|
|
|
|
|
|
|
|
|
return _singleton;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|