I'm still hitting this bug with spine-unity code from May or June, with Unity 5.3.4f1. I believe the problem is that AssetDatabase.SaveAssets() can ultimately cause any assets created on the stack to get unloaded. See here: http://docs.unity3d.com/ScriptReference/Resources.UnloadUnusedAssets.html
It would appear this can be fixed by creating a static variable that holds a reference to atlasAsset during the entire IngestSpineAtlas() function. Of course, since OnPostprocess*() calls can be re-entrant, this variable needs to be a list for safety, not just a single reference.
I believe the fix is to change SpineEditorUtilities like the following...
Add near the top:
private static List<AtlasAsset> garbageCollectBlockerAssetList;
Add to Initialize():
garbageCollectBlockerAssetList = new List<AtlasAsset>();
In IngestSpineAtlas(), add somewhere after the atlasAsset = CreateInstance:
garbageCollectBlockerAssetList.Add(atlasAsset);
And somewhere near the end of the function:
garbageCollectBlockerAssetList.Remove(atlasAsset);
I haven't seen it yet, but it's possible that IngestSpineProject might also cause this.
27 Jul 2016, 16:47
In talking with Unity support, I've confirmed my theory from above. Calling AssetDatabase functions can trigger an Asset Garbage Collect if there's enough memory pressure (i.e. larger Unity projects), which will indeed unload assets that are purely held on the stack. These assets fall into that category, and so they can get unloaded on the SaveAssets() call only if there's enough memory pressure at the point it gets called. This ultimately leads to the MissingReferenceException being thrown, which also has a side effect of causing all remaining assets being processed in the OnPostprocessAllAssets() call to not get processed.
The fix I propose above appears to be sufficient for solving this problem in the testing I've done.