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,并使用引用计数

posted @ 2016-04-20 15:33  00000000O  阅读(933)  评论(0编辑  收藏  举报