Closed laicasaane closed 7 months ago
Probably a Unity regression as it's working fine on 2019.4.
This issue is stale because it has been open 14 days with no activity. It will be automatically closed in 7 days.
I am also getting this error Unity 2022.3.16f1
Unity seem to dispose/invalidate atlas asset editor before the build is complete (and even before the draw is finished):
— after Build()
is invoked, editor's OnDisable()
gets called (which indicates Unity decides to dispose the editor and serializedAsset
instance with it) before control flow exits the method. This is most likely a regression on the Unity side, as the behavior is weird and didn't happen in previous Unity releases.
I'm not using 2022 myself; would appreciate if someone can send a bug report to Unity and/or have an idea of a workaround/temp fix, which doesn't require significant changes on our side.
I've traced it down to AssetDatabase.SaveAssets()
call:
Seems like invoking those causes Unity to dispose the editor. After removing all the "SaveAssets" in all the editors (except the last one at the end of build), it seems to work fine, until you change any property, at which point it fails again, but works when repeated. As a temp workaround (until the bug is fixed on the Unity side), try removing the save calls and build twice after changing atlas properties.
Unity 2022.3.14 SpriteDicing 1.10.0
I'm receiving this exception when trying tpo build the atlas.