Unity AnimatorController注意事项


通过assetbundle加载的单独打包AnimatorController使用下面方法赋值

Go.GetComponent<Animator>().runtimeAnimatorController = (RuntimeAnimatorController) obj;


通过Resouce.load 加载的AnimatorController使用

Go.GetComponent<Animator>().runtimeAnimatorController = (RuntimeAnimatorController)RuntimeAnimatorController.Instantiate(obj);


原因是Resouce实际没真正加载资源,而bundle方式资源以及被加载进来了

猜测是Resouce导入的没有引用计数,不会自动clone,而bundle会自动clone,并使用引用计数

原文地址:https://www.cnblogs.com/nafio/p/9137367.html