Hi,
Yesterday I downloaded the latest version of the runtime and upgraded our project to use it. One of the game objects in the scene uses a Spine animation. During the game, we show/hide it by activating/deactivating the game object, which at some point calls OnDisable/OnEnable event callbacks, respectively.
It was working fine until yesterday, now I'm getting missing reference exceptions in SkeletonRenderer::LateUpdate, line 315:
// Double buffer mesh.
Mesh mesh = useMesh1 ? mesh1 : mesh2;
meshFilter.sharedMesh = mesh;
mesh.vertices = vertices; // The exception is thrown here
Debugging shows that the OnDisable() implementation for SkeletonRenderer, which was recently added, calls Destroy() on the two meshes but it doesn't null them. As a result, the next call to OnEnable() will/may not invoke Reset(), so they won't be rebuilt.
public virtual void OnEnable() {
if(mesh1 == null || mesh2 == null)
Reset();
}
public virtual void OnDisable() {
if (Application.isPlaying && gameObject.activeInHierarchy == false) {
if (mesh1 != null)
Destroy(mesh1);
if (mesh2 != null)
Destroy(mesh2);
}
I've tried to set mesh1 and mesh2 to null after calling "Destroy()" and it seems to fix the problem.