20 lines
256 B
C#
20 lines
256 B
C#
namespace UltimateWater.Internal
|
|
{
|
|
public class Singleton<T> where T : new()
|
|
{
|
|
private static T _Instance;
|
|
|
|
public static T Instance
|
|
{
|
|
get
|
|
{
|
|
if (_Instance == null)
|
|
{
|
|
_Instance = new T();
|
|
}
|
|
return _Instance;
|
|
}
|
|
}
|
|
}
|
|
}
|