Reply To: [BUG] Blackboard losing UnityEngine.Object references

NodeCanvas Forums Support [BUG] Blackboard losing UnityEngine.Object references Reply To: [BUG] Blackboard losing UnityEngine.Object references

anton petrov

Okay, this is very strange Unity behaviour. I’ve made this very simple script:

Then I created prefab A referencing a prefab B through this component.
Then I’ve deleted Library folder as was suggested by the author.
After Unity restarted the Console output was:

Rebuilding Library because the asset database could not be found!
type=UnityEngine.Object isNull=True
type=UnityEngine.Object isNull=True

Then I’ve selected the prefab A and it produced output:
type=UnityEngine.GameObject isNull=False

So looks like on assets reimport references are in some invalid state. And reference type is wrong as you can see and this breaks entire Blackboard.OnAfterDeserialize() logic.

It scares me because NodeCanvas relies heavily on ISerializationCallbackReceiver callbacks and uses UnityEngine.Objects references withing these callbacks.


Now I understand that Unity cannot resolve this issue because objects can reference each other forming circular dependencies so there is no way to provide valid references in OnAfterDeserialize() for all of them.