单例模式
生成
饿汉式单例
private static SingleTon _instance;
(按照ctrl+r+e可以直接封装get set方法)
public static Singleton Instance
{
get
{
return_instance;
}
}
private void Awake()
{
_instance=this;
}
单例模式
生成
饿汉式单例
private static SingleTon _instance;
(按照ctrl+r+e可以直接封装get set方法)
public static Singleton Instance
{
get
{
return_instance;
}
}
private void Awake()
{
_instance=this;
}