Reply To: Unable to Export Prefabs

NodeCanvas Forums Support Unable to Export Prefabs Reply To: Unable to Export Prefabs

#13582
Gavalakis
Keymaster

Hello,

So, after checking this out in a clean project and building a bundle out of a prefab, I found the issue related to the error Inconsistent asset when sorting preload assets: ” fileID: 0. Even though the problem does not seem to affect the asset building, it is still annoying.

Within GraphOwner.OnValidate method and line #288, for editor convenience and to preload bound graphs even when the object is a prefab, I create an instance of the bound graph and set it’s HideFlags to HideFlags.HideAndDontSave, (which is actually also recommended by Unity by the way).
It seems though, that Unity don’t like this when building asset bundles due to the graph reference being a ‘TypeMismatch’ (which in general is not a problem).

TypeMismatch

Thus, if we change line #288 to set the HideFlags to HideFlags.None, asset bundles will be created without the fileID: 0 error (or any error at all from my tests). The only downside of doing this change, is that bound graphs on prefab GraphOwners, will not be pre-loaded, and thus I will need to find another way to pre-load them, probably in the GraphOwnerInspector.OnEnable instead of in OnValidate.

Can you please give it a try and change GraphOwner.OnValidate at line #288 to this: boundGraphInstance.hideFlags = HideFlags.None; just to confirm you are able to build asset bundle without this error?

Thank you!

Join us on Discord: https://discord.gg/97q2Rjh

Attachments:
  1. TypeMismatch.png