20 lines
376 B
C#
20 lines
376 B
C#
|
namespace Script.UI
|
|||
|
{
|
|||
|
public class SingleManager<T> where T : class, new()
|
|||
|
{
|
|||
|
private static T instance;
|
|||
|
|
|||
|
public static T Instance
|
|||
|
{
|
|||
|
get
|
|||
|
{
|
|||
|
if (instance == null)
|
|||
|
{
|
|||
|
instance = new T();
|
|||
|
}
|
|||
|
|
|||
|
return instance;
|
|||
|
}
|
|||
|
}
|
|||
|
}
|
|||
|
}
|