Errors when exiting the editor when the StartEquipUnequip task is completed

And I want to add that after errors, you can’t select Category in Category ID, it’s always Null, only restarting Unity helps

An Inventory component is required for an ItemSetManager.
UnityEngine.Debug:LogError (object)
Opsive.UltimateCharacterController.Inventory.ItemSetManagerBase:Initialize (bool) (at ./Packages/com.opsive.ultimatecharactercontroller/Runtime/Inventory/ItemSetManagerBase.cs:95)
Opsive.BehaviorDesigner.Integrations.UltimateCharacterController.Editor.ItemSetCategoryControl:GetIndex (Opsive.UltimateCharacterController.Inventory.ItemSetManagerBase,System.Collections.Generic.List`1<string>,uint) (at Assets/Opsive/BehaviorDesigner/Integrations/UltimateCharacterController/Editor/UltimateCharacterControllerControlTypes.cs:130)
Opsive.BehaviorDesigner.Integrations.UltimateCharacterController.Editor.ItemSetCategoryControl:AddItemSetManagerCategories (Opsive.Shared.Editor.UIElements.Controls.Types.TypeControlBase/TypeControlInput,UnityEngine.UIElements.VisualElement,Opsive.UltimateCharacterController.Inventory.ItemSetManagerBase) (at Assets/Opsive/BehaviorDesigner/Integrations/UltimateCharacterController/Editor/UltimateCharacterControllerControlTypes.cs:72)
Opsive.BehaviorDesigner.Integrations.UltimateCharacterController.Editor.ItemSetCategoryControl:GetControl (Opsive.Shared.Editor.UIElements.Controls.Types.TypeControlBase/TypeControlInput) (at Assets/Opsive/BehaviorDesigner/Integrations/UltimateCharacterController/Editor/UltimateCharacterControllerControlTypes.cs:56)
Opsive.Shared.Editor.UIElements.Controls.Types.TypeControlBase:GetTypeControl (Opsive.Shared.Editor.UIElements.Controls.Types.TypeControlBase/TypeControlInput)
Opsive.Shared.Editor.UIElements.FieldInspectorView:AddTypeControl (UnityEngine.Object,object,System.Reflection.FieldInfo,UnityEditor.SerializedProperty,int,System.Type,string,string,Opsive.Shared.Editor.UIElements.Controls.LabelControl/WidthAdjustment,object,UnityEngine.UIElements.VisualElement,bool,System.Action`2<UnityEngine.UIElements.VisualElement, System.Reflection.FieldInfo>,System.Func`2<object, bool>,System.Action,object)
Opsive.Shared.Editor.UIElements.FieldInspectorView:AddField (Opsive.Shared.Editor.UIElements.FieldInspectorView/InspectorInput)

MissingReferenceException: The object of type 'Opsive.UltimateCharacterController.Integrations.UltimateInventorySystem.CharacterInventoryBridge' has been destroyed but you are still trying to access it.
Your script should either check if it is null or you should not destroy the object.
UnityEngine.Object+MarshalledUnityObject.TryThrowEditorNullExceptionObject (UnityEngine.Object unityObj, System.String parameterName) (at <98fbc9de20ae47d9bb2559ab79ec6643>:0)
UnityEngine.Bindings.ThrowHelper.ThrowNullReferenceException (System.Object obj) (at <98fbc9de20ae47d9bb2559ab79ec6643>:0)
UnityEngine.Component.get_gameObject () (at <98fbc9de20ae47d9bb2559ab79ec6643>:0)
UnityEngine.Component.GetComponentsInChildren[T] (System.Boolean includeInactive) (at <98fbc9de20ae47d9bb2559ab79ec6643>:0)
Opsive.UltimateCharacterController.Inventory.InventoryBase.DetermineSlotCount () (at ./Packages/com.opsive.ultimatecharactercontroller/Runtime/Inventory/InventoryBase.cs:152)
 
Thanks, I see what's happening. On line 93 of the ItemSetManagerBase change:

Code:
m_Inventory = m_GameObject.GetCachedComponent<InventoryBase>();

to:

Code:
            if (Application.isPlaying) {
                m_Inventory = m_GameObject.GetCachedComponent<InventoryBase>();
            } else {
                m_Inventory = m_GameObject.GetComponent<InventoryBase>();
            }
 
Back
Top