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

(197评价)
价格: 4431.00元
行为树插件问题
中文一号发起了问答2017-09-05
1
回复
1641
浏览

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条回复,点击查看
    你还没有登录,请先登录注册
发表回复
你还没有登录,请先 登录或 注册!