先上代码:
Object o;
GameObject go;
void Start()
{
o = Resource.Load("pic");
go = (GameObject)Instantiate(o);
StartCoroutine(WaitAndPrint(2.0F));
}
IEnumerator WaitAndPrint(float time)
{
yield return new WaitForSeconds(time);
Resource.UnloadAsset(o);
}
今天在测试资源卸载的时候,报了一个错:
UnloadAsset may only be used on individual assets and can not be used on </