Unity - A计划(永久有效期) 扫二维码继续学习 二维码时效为半小时

(207评价)
优惠后 ¥1899.00优惠前 ¥2499.00 双十一全年最大力度限时优惠
1对1 答疑即时回复7天无理由退款30天价保提问必答

服务保障

1对1 答疑

提供专属的一对一在线答疑,快速答疑解惑。

即时回复

及时响应学习咨询,帮助解决问题。

7天无理由退款

购买后7天内可申请无理由退款。

30天价保

购买后30天内如遇降价,可申请价保。

提问必答

对于提问做到有问必答,帮您扫清学习过程中的种种障碍

行为树插件问题
中文一号发起了问答2017-09-05
1
回复
2076
浏览

CTF案例中的问题:当设置Defence的站岗位置时,老师在视频上教的是定义局部变量,然后用同步去设置Transform,但我点击同步按钮时,报空引用异常。具体的报错很长。

NullReferenceException: Object reference not set to an instance of an object
BehaviorDesigner.Editor.VariableInspector.AddPropertyName (BehaviorDesigner.Runtime.SharedVariable sharedVariable, UnityEngine.GameObject gameObject, System.Collections.Generic.List`1& propertyNames, System.Collections.Generic.List`1& propertyGameObjects, Boolean behaviorGameObject)
BehaviorDesigner.Editor.VariableInspector.ShowPropertyMappingMenu (BehaviorDesigner.Runtime.BehaviorSource behaviorSource, BehaviorDesigner.Runtime.SharedVariable sharedVariable)
BehaviorDesigner.Editor.VariableInspector.DrawSharedVariable (IVariableSource variableSource, BehaviorDesigner.Runtime.SharedVariable sharedVariable, Boolean selected)
BehaviorDesigner.Editor.VariableInspector.DrawAllVariables (Boolean showFooter, IVariableSource variableSource, System.Collections.Generic.List`1& variables, Boolean canSelect, System.Collections.Generic.List`1& variablePosition, System.Int32& selectedVariableIndex, System.String& selectedVariableName, System.Int32& selectedVariableTypeIndex, Boolean drawRemoveButton, Boolean drawLastSeparator)
BehaviorDesigner.Editor.VariableInspector.DrawVariables (IVariableSource variableSource, Boolean enabled, BehaviorDesigner.Runtime.BehaviorSource behaviorSource, System.String& variableName, System.Boolean& focusNameField, System.Int32& variableTypeIndex, UnityEngine.Vector2& scrollPosition, System.Collections.Generic.List`1& variablePosition, System.Single& variableStartPosition, System.Int32& selectedVariableIndex, System.String& selectedVariableName, System.Int32& selectedVariableTypeIndex)
BehaviorDesigner.Editor.VariableInspector.DrawVariables (BehaviorDesigner.Runtime.BehaviorSource behaviorSource, Boolean enabled)
BehaviorDesigner.Editor.BehaviorDesignerWindow.DrawPropertiesBox ()
BehaviorDesigner.Editor.BehaviorDesignerWindow.Draw ()
BehaviorDesigner.Editor.BehaviorDesignerWindow.OnGUI ()
System.Reflection.MonoMethod.Invoke (System.Object obj, BindingFlags invokeAttr, System.Reflection.Binder binder, System.Object[] parameters, System.Globalization.CultureInfo culture) (at /Users/builduser/buildslave/mono/build/mcs/class/corlib/System.Reflection/MonoMethod.cs:222)

 

 

 

 

 

 

 

 

所有回复
  • siki • 2017-09-06

    首先检查unity的版本是否跟我的一致,这个有可能是版本不兼容导致的

    如果版本没问题的话,双击下错误,定位到错误位置,看看代码

    还有-5条回复,点击查看
    你还没有登录,请先登录或注册!
发表回复
你还没有登录,请先 登录或 注册!