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,并使用引用计数
Go.GetComponent<Animator>().runtimeAnimatorController = (RuntimeAnimatorController) obj;
通过Resouce.load 加载的AnimatorController使用
Go.GetComponent<Animator>().runtimeAnimatorController = (RuntimeAnimatorController)RuntimeAnimatorController.Instantiate(obj);
原因是Resouce实际没真正加载资源,而bundle方式资源以及被加载进来了
猜测是Resouce导入的没有引用计数,不会自动clone,而bundle会自动clone,并使用引用计数
相关文章推荐
- Unity3D 学习日记(四)生成不重复的随机数
- unity发布Android默认启动类
- unity 实现流光效果
- unity 实现流光效果
- 【Unity3D游戏开发】material与sharedMaterial的区别 (三八)
- 在unity中体验uwebkit插件过程中遇见的几个问题
- Unity3D学习日记(三)贝塞尔曲线
- Unity之2d对象跟随鼠标旋转
- unity 获取当前键盘按键
- 【NGUI】Unity中使用NGUI和FingerGestures插件点击UI穿透的问题
- 浅谈RenderTexture的shadowmap格式
- unity各种路径
- unity3d c# 之事件
- Unity3d 实现顶点动画
- Unity3d 实现顶点动画
- Unity中将图片改为支持透明背景模式
- 小译UnityAPI-Mathf.Lerp
- unityc#脚本中实现socket服务器的构建
- 关于unity的CGIncludes的一些小问题
- Unity3D对安卓盒子的支持