16 lines
347 B
C#
16 lines
347 B
C#
|
namespace PhxhSDK
|
||
|
{
|
||
|
public abstract class Singlenton<T> where T : class, new()
|
||
|
{
|
||
|
private static T _instance;
|
||
|
|
||
|
public static T Instance => GetSingleton();
|
||
|
|
||
|
public static T GetSingleton()
|
||
|
{
|
||
|
if (_instance == null)
|
||
|
_instance = new T();
|
||
|
return _instance;
|
||
|
}
|
||
|
}
|
||
|
}
|