jimi
Member
Hey there,
There is a game breaking case if a Interactable is destroyed while still serialized in the InventoryInteractor.m_Interactables array.
I've been trying to be good at making sure they are all removed but if one is missed you'll get an error thrown and will never be able to play the game without restarting.
As a fail safe I've added an event in Interactable.OnDisable(). Just remembered to put it back after last update but thought it may be beneficial for all if it was added to UIS
There is a game breaking case if a Interactable is destroyed while still serialized in the InventoryInteractor.m_Interactables array.
I've been trying to be good at making sure they are all removed but if one is missed you'll get an error thrown and will never be able to play the game without restarting.
Code:
MissingReferenceException: The object of type 'Interactable' has been destroyed but you are still trying to access it.
As a fail safe I've added an event in Interactable.OnDisable(). Just remembered to put it back after last update but thought it may be beneficial for all if it was added to UIS
Code:
void OnDisable()
{
EventHandler.ExecuteEvent<IInteractor>(gameObject, EventNames.c_Interactable_OnDeselect_IInteractor, cachedInteractor);
}