skyblue_2012 2016-03-23 19:16 采纳率: 50%
浏览 3430

unity3d脚本添加时出现错误

NullReferenceException: Object reference not set to an instance of an object
UnityEditor.TreeViewDragging.DragElement (UnityEditor.TreeViewItem targetItem, Rect targetItemRect, Boolean firstItem) (at C:/BuildAgent/work/d63dfc6385190b60/Editor/Mono/GUI/TreeView/TreeViewDragging.cs:201)
UnityEditor.TreeView.HandleUnusedMouseEventsForNode (Rect rect, UnityEditor.TreeViewItem item, Boolean firstItem) (at C:/BuildAgent/work/d63dfc6385190b60/Editor/Mono/GUI/TreeView/TreeView.cs:304)
UnityEditor.TreeView.OnGUI (Rect rect, Int32 keyboardControlID) (at C:/BuildAgent/work/d63dfc6385190b60/Editor/Mono/GUI/TreeView/TreeView.cs:408)
UnityEditor.SceneHierarchyWindow.DoTreeView

  • 写回答

2条回答 默认 最新

  • herozhangbz 2016-03-24 08:17
    关注

    201行,对象的引用未设置到对象的实例。应该是引用的时候可能没有这个实例或者物体,引用出错了。304不知道,看着像UnityEditor.TreeView.HandleUnusedMouseEventsForNode函数后面的Rect rect, UnityEditor.TreeViewItem item, Boolean firstItem三个参数你弄错了。408跟304差不多UnityEditor.TreeView.OnGUI函数后面两个参数你检查检查。

    评论

报告相同问题?

悬赏问题

  • ¥15 sqlite 附加(attach database)加密数据库时,返回26是什么原因呢?
  • ¥88 找成都本地经验丰富懂小程序开发的技术大咖
  • ¥15 如何处理复杂数据表格的除法运算
  • ¥15 如何用stc8h1k08的片子做485数据透传的功能?(关键词-串口)
  • ¥15 有兄弟姐妹会用word插图功能制作类似citespace的图片吗?
  • ¥200 uniapp长期运行卡死问题解决
  • ¥15 请教:如何用postman调用本地虚拟机区块链接上的合约?
  • ¥15 为什么使用javacv转封装rtsp为rtmp时出现如下问题:[h264 @ 000000004faf7500]no frame?
  • ¥15 乘性高斯噪声在深度学习网络中的应用
  • ¥15 关于docker部署flink集成hadoop的yarn,请教个问题 flink启动yarn-session.sh连不上hadoop,这个整了好几天一直不行,求帮忙看一下怎么解决