Handle destroyed Collectables
landosilva opened this issue · 0 comments
landosilva commented
Steps to reproduce:
▶⠀Create a new Collection
▶⠀Add new Collectables to it, of the base type
▶⠀Create a GameObject "A", with a script with a Serialised variable of the type of the Collectable
▶⠀Go to the Collectable class file, change it to abstract
▶⠀Select the Collection Scriptable Object, should see:
ArgumentException: Object at index 0 is null
▶⠀Select GameObject "A", should see:
MissingReferenceException: The object of type 'CollectableScriptableObject' 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.