NullReferenceException UnityEngine.Transform.get_localPosition
2015-12-27 13:49
537 查看
NullReferenceException UnityEngine.Transform.get_localPosition
unity程序中,需要取得GO自身的Transform,出现如上空异常,这看起来很荒谬。
其实是代码其他函数中,获取对象发生异常,比如在编辑器中没有赋值就使用。出现引用异常。
这就会间接导致程序出现如上异常。
unity3d经常因为程序某个函数出现问题,而导致全局脚本出现引用失效。
unity3d官方论坛解释。
NullReferenceException are thrown when you try to access a reference variable that isnt referencing any object, hence it is null. So the first question, are all variables reference types?
http://answers.unity3d.com/questions/47830/what-is-a-null-reference-exception-in-unity.html
unity程序中,需要取得GO自身的Transform,出现如上空异常,这看起来很荒谬。
其实是代码其他函数中,获取对象发生异常,比如在编辑器中没有赋值就使用。出现引用异常。
这就会间接导致程序出现如上异常。
unity3d经常因为程序某个函数出现问题,而导致全局脚本出现引用失效。
unity3d官方论坛解释。
NullReferenceException are thrown when you try to access a reference variable that isnt referencing any object, hence it is null. So the first question, are all variables reference types?
http://answers.unity3d.com/questions/47830/what-is-a-null-reference-exception-in-unity.html
相关文章推荐
- Unity3D 调用模态对话框/Unity3D MessageBox
- Unity3D-微信-飞机大战-项目经过
- 【Unity Shaders】使用CgInclude让你的Shader模块化——Unity内置的CgInclude文件
- 关于Unity3D的编辑器崩溃时的线索定位
- UNITY 位移
- unity shader的固定管线(fixed function shader)
- [置顶] unity3d基于ugui的ui模块
- {Unity} Shader初步
- {Unity} 2D游戏,Canvas转世界坐标
- {Unity} Renderer SortingOrder的取值范围
- Unity -网格合并
- unity3d 如何判断一点是不是在一个相机的视锥内
- Unity3d ulua 环境搭建与所遇到的问题
- unity自带寻路Navmesh入门教程(一)
- KING_UNITY学习之鼠标点击地面控制人物移动
- 实例教程Unity3D单例模式(一)通经常使使用方法
- unity build设置固定分辨率不生效的问题
- Unity3d截图方法合集
- Unity3d 异常与解决方案集合(持续)
- Unity3D行为树插件Behave学习笔记