IndieGame/client/Assets/Ether/Scripts/Common/Singleton/Singleton.cs

30 lines
665 B
C#
Raw Permalink Normal View History

2024-10-11 10:12:15 +08:00
/********************************************************************
: Singleton.cs
:
: 1982614048@qq.com
: 2024/03/29 17:28:19
:
: 2024/04/03 16:05:58
:
*********************************************************************/
using System;
using System.Collections.Generic;
using System.Linq;
public class Singleton<T> where T : new()
{
private static T instance;
public static T Inst
{
get
{
if (instance == null)
{
instance = new T();
}
return instance;
}
}
}