'DontDestroyOnload'该名称在当前上下文中不 存在_
想知道这个报错是什么原因导致的,又怎样解决呢?
protected virtual void Awake()
{
if(Instance == null)
{
Instance = (T)this;
DontDestroyOnload(this.gameObject);
}
else
{
Destroy(this.gameObject);
}
}
你的脚本应该没有继承Monobehaviour吧