StateBehaviourEditorGUIでnull reference例外発生

ここは、Arbor開発者へ不具合を報告するためのフォーラムです。
報告に必要な項目は以下の通りです。
  • OS(必須)
  • Unityバージョン(必須)
  • Arborバージョン(必須)
  • 再現方法(必須)
  • ビルドプラットフォーム
  • 再現プロジェクト(Arborや他アセットなどを含まない最小構成)もしくは動画
注意:Unityのベータ版およびアルファ版はサポート対象外です。正式リリース版をご利用ください。

Here is a forum for reporting failure to Arbor developer.
The items necessary for reporting are as follows.
  • OS(Required)
  • Unity version(Required)
  • Arbor version(Required)
  • How to reproduce(Required)
  • Build platform
  • Reproduction project (Minimum configuration not including Arbor and other assets) or video
Note: Unity beta and alpha versions are not supported. Please use the official release version.
Forum rules
報告に必要な項目は以下の通りです。
  • OS(必須)
  • Unityバージョン(必須)
  • Arborバージョン(必須)
  • 再現方法(必須)
  • ビルドプラットフォーム
  • 再現プロジェクト(Arborや他アセットなどを含まない最小構成)もしくは動画
注意:Unityのベータ版およびアルファ版はサポート対象外です。正式リリース版をご利用ください。

The items necessary for reporting are as follows.
  • OS(Required)
  • Unity version(Required)
  • Arbor version(Required)
  • How to reproduce(Required)
  • Build platform
  • Reproduction project (Minimum configuration not including Arbor and other assets) or video
Note: Unity beta and alpha versions are not supported. Please use the official release version.
kag
Posts: 31
Joined: 2017/05/19 08:28

StateBehaviourEditorGUIでnull reference例外発生

Post by kag » 2018/12/19 02:24

Unity: 2018.2.14
Arbor: 3.4.1 (前バージョン 3.3.2)
OS: Windows

いつもお世話になっております。

StateBehaviourに、
[SerializeField]
List<ArborFSM> m_test = new List<ArborFSM>();
のように定義し、Inspectorで配列数を増やした段階で、次のような例外が発生するようになってしまいました。
また、すでにArborFSMのオブジェクトがセットされているところでは、別の箇所(StateBehaviourEditorGUI.cs:112)で例外が発生します。
すでにこのような実装を行い設定をしている箇所が多々あるため、
変数の定義の仕方を変えずに対処をお願いします。

よろしくお願いします。

Code: Select all

 NullReferenceException: Object reference not set to an instance of an object
 (wrapper dynamic-method) System.Object.(object)
 Arbor.DynamicReflection.DynamicField+DelegatedField.GetValue (System.Object instance) (at 
 Assets/Plugins/Arbor/Internal/Scripts/DynamicReflection/DynamicField.cs:260)
 Arbor.Serialization.SerializeFieldInfo.GetValue (System.Object instance) (at 
 Assets/Plugins/Arbor/Internal/Scripts/Serialization/SerializeFieldInfo.cs:106)
 ArborEditor.StateBehaviourEditorGUI.UpdateStateLinkProperty (UnityEditor.SerializedProperty property, System.Reflection.FieldInfo fieldInfo, 
 System.Type fieldType, System.Object value) (at Assets/Plugins/Arbor/Internal/Editor/NodeEditors/StateBehaviourEditorGUI.cs:109)
 ArborEditor.StateBehaviourEditorGUI.UpdateStateLinkProperty (UnityEditor.SerializedProperty property, System.Reflection.FieldInfo fieldInfo, 
 System.Type fieldType, System.Object value) (at Assets/Plugins/Arbor/Internal/Editor/NodeEditors/StateBehaviourEditorGUI.cs:90)
 ArborEditor.StateBehaviourEditorGUI.UpdateStateLinkInternal () (at 
 Assets/Plugins/Arbor/Internal/Editor/NodeEditors/StateBehaviourEditorGUI.cs:159)
 ArborEditor.StateBehaviourEditorGUI.UpdateStateLink () (at Assets/Plugins/Arbor/Internal/Editor/NodeEditors/StateBehaviourEditorGUI.cs:175)
 ArborEditor.StateEditor.UpdateBehaviour () (at Assets/Plugins/Arbor/Internal/Editor/NodeEditors/StateEditor.cs:107)
 ArborEditor.StateMachineGraphEditor.DrawStateLinkBranchies () (at 
 Assets/Plugins/Arbor/Internal/Editor/GraphEditors/StateMachineGraphEditor.cs:537)
 ArborEditor.StateMachineGraphEditor.OnDrawBranchies () (at Assets/Plugins/Arbor/Internal/Editor/GraphEditors/StateMachineGraphEditor.cs:561)
 ArborEditor.NodeGraphEditor.BeginDrawBranch () (at Assets/Plugins/Arbor/Internal/Editor/GraphEditors/NodeGraphEditor.cs:939)
 ArborEditor.NodeGraphEditor.BeginGraphGUI (System.Boolean useOverlayLayer) (at 
 Assets/Plugins/Arbor/Internal/Editor/GraphEditors/NodeGraphEditor.cs:505)
 ArborEditor.ArborEditorWindow.GraphGUI () (at Assets/Plugins/Arbor/Internal/Editor/Windows/ArborEditorWindow.cs:2114)
 ArborEditor.ArborEditorWindow.GraphViewGUI () (at Assets/Plugins/Arbor/Internal/Editor/Windows/ArborEditorWindow.cs:2073)
 ArborEditor.ArborEditorWindow.<SetupGUI>m__C () (at Assets/Plugins/Arbor/Internal/Editor/Windows/ArborEditorWindow.cs:2609)
 UnityEngine.Experimental.UIElements.IMGUIContainer.DoOnGUI (UnityEngine.Event evt, System.Boolean isComputingLayout) (at 
 C:/buildslave/unity/build/Modules/UIElements/IMGUIContainer.cs:238)
 UnityEngine.Experimental.UIElements.IMGUIContainer.HandleIMGUIEvent (UnityEngine.Event e) (at 
 C:/buildslave/unity/build/Modules/UIElements/IMGUIContainer.cs:376)
 UnityEngine.Experimental.UIElements.IMGUIContainer.HandleEvent (UnityEngine.Experimental.UIElements.EventBase evt) (at 
 C:/buildslave/unity/build/Modules/UIElements/IMGUIContainer.cs:355)
 UnityEngine.Experimental.UIElements.EventDispatcher.PropagateEvent (UnityEngine.Experimental.UIElements.EventBase evt) (at 
 C:/buildslave/unity/build/Modules/UIElements/EventDispatcher.cs:500)
 UnityEngine.Experimental.UIElements.EventDispatcher.DispatchEvent (UnityEngine.Experimental.UIElements.EventBase evt, 
 UnityEngine.Experimental.UIElements.IPanel panel) (at C:/buildslave/unity/build/Modules/UIElements/EventDispatcher.cs:345)
 UnityEngine.Experimental.UIElements.UIElementsUtility.DoDispatch (UnityEngine.Experimental.UIElements.BaseVisualElementPanel panel) (at 
 C:/buildslave/unity/build/Modules/UIElements/UIElementsUtility.cs:243)
 UnityEngine.Experimental.UIElements.UIElementsUtility.ProcessEvent (System.Int32 instanceID, System.IntPtr nativeEventPtr) (at 
 C:/buildslave/unity/build/Modules/UIElements/UIElementsUtility.cs:74)
 UnityEngine.GUIUtility.ProcessEvent (System.Int32 instanceID, System.IntPtr nativeEventPtr) (at 
 C:/buildslave/unity/build/Modules/IMGUI/GUIUtility.cs:171)
 

User avatar
caitsithware
管理人
Posts: 294
Joined: 2015/08/17 12:41

Re: StateBehaviourEditorGUIでnull reference例外発生

Post by caitsithware » 2018/12/19 05:27

ご報告ありがとうございます。

StateLinkを列挙する際に、UnityEngine.Object型の配列もしくはListを除外し忘れていました。
次の更新で修正いたします。
それまでの間以下の暫定対処を行ってください。

暫定対処方法:
  • Assets/Plugins/Arbor/Internal/Scripts/EachField.csをコードエディタで開く。
  • 205目のif文を以下のように変更。

    Code: Select all

    if (IsTargetType(elementType) || (!EachFieldUtility.IsIgnoreType(elementType) && AttributeHelper.HasAttribute<System.SerializableAttribute>(TypeUtility.GetMemberInfo(elementType)) && HasFields(elementType)))
    
ご不便おかけして申し訳ございませんがよろしくお願いいたします。

kag
Posts: 31
Joined: 2017/05/19 08:28

Re: StateBehaviourEditorGUIでnull reference例外発生

Post by kag » 2018/12/20 06:35

対応ありがとうございます。
解消されました。

Locked