您的位置:首页 > 移动开发 > Unity3D

Unity AnimatorController注意事项

2016-04-20 15:33 507 查看
通过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,并使用引用计数
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签: