Unityバージョン: 2021.2.15f1
Arborバージョン: 3.8.9
再現方法: AnimatorOverrideControllerをAgentControllerのAnimatorに設定する
エラー内容
ArgumentNullException: Value cannot be null.
Parameter name: key
System.Collections.Generic.Dictionary`2[TKey,TValue].FindEntry (TKey key) (at <feaaa6313e32495d9f259b175aa6b597>:0)
System.Collections.Generic.Dictionary`2[TKey,TValue].TryGetValue (TKey key, TValue& value) (at <feaaa6313e32495d9f259b175aa6b597>:0)
ArborEditor.EditorGUITools.GetAnimatorParameters (UnityEditor.Animations.AnimatorController animatorController) (at Assets/Plugins/Arbor/Internal/Editor/EditorGUITools.cs:1954)
ArborEditor.EditorGUITools.AnimatorParameterField (UnityEngine.Rect position, UnityEngine.Animator animator, UnityEditor.SerializedProperty nameProperty, UnityEditor.SerializedProperty typeProperty, UnityEngine.GUIContent label, System.Boolean hasType, UnityEngine.AnimatorControllerParameterType parameterType) (at Assets/Plugins/Arbor/Internal/Editor/EditorGUITools.cs:1973)
ArborEditor.EditorGUITools.AnimatorParameterField (UnityEngine.Animator animator, UnityEditor.SerializedProperty nameProperty, UnityEditor.SerializedProperty typeProperty, UnityEngine.GUIContent label, UnityEngine.AnimatorControllerParameterType parameterType) (at Assets/Plugins/Arbor/Internal/Editor/EditorGUITools.cs:2078)
ArborEditor.AgentControllerInspector.OnInspectorGUI () (at Assets/Plugins/Arbor/BuiltInBehaviours/Editor/Components/AgentControllerInspector.cs:70)
UnityEditor.UIElements.InspectorElement+<>c__DisplayClass59_0.<CreateIMGUIInspectorFromEditor>b__0 () (at <fa4830dcb55b4d21a18ffd468621039e>:0)
UnityEngine.GUIUtility:ProcessEvent(Int32, IntPtr, Boolean&)
AnimatorOverrideControllerの場合、Assets/Plugins/Arbor/Internal/Editor/EditorGUITools.cs の L1969
Code: Select all
AnimatorController animatorController = animator.runtimeAnimatorController as AnimatorController;
以下のようにAnimatorOverrideControllerの場合を考慮するとエラーが解消され設定できるようになりました。
ご確認よろしくお願いいたします。
Code: Select all
AnimatorController animatorController;
if (animator.runtimeAnimatorController is AnimatorOverrideController)
{
var animatorOverrideController = animator.runtimeAnimatorController as AnimatorOverrideController;
animatorController = animatorOverrideController.runtimeAnimatorController as AnimatorController;
}
else
{
animatorController = animator.runtimeAnimatorController as AnimatorController;
}