注释
在进行简单编写类的时候不需要进行复杂单例的继承,可以简单进行单利的编写
#region 单例
private static T _instance;
public static T Instace
{
get
{
if (_instance == null)
{
_instance = FindObjectOfType<T>();
}
return _instance;
}
}
#endregion
#region 单例
public static T Instance;
private void Awake()
{
Instance = this;
}
#endregion