In short: I am emitting particles with the Particle System, its shape module has the Spines mesh referenced. Whenever I stop the particle system I get errors. The spine has a SkeletonRenderSeparator.
More detailed: My Spine character has a SkeletonRenderSeparator. During gameplay the character can catch fire. The fire is a pooled object with a Particle System, that has its Shape module set to “Mesh Renderer” and Type to “Triangle”. When the fire gets attached to the character, the Particle System sets its referenced Mesh to one of the characters Parts Renderers (see the SkeletonRenderSeparator).
When the fire is done, it returns to the pool. It sets all previous references to the character to null (e.g. “Mesh” in the particle system gets nulled). Also I Stop and Clear the Particle System. Even though I’ve done all that, I get this error whenever the character animates (this error starts after the fire got disabled):
Particle System can only spawn from mesh if all submeshes use the same primitive type
UnityEngine.Mesh:SetTriangles (int[],int,int,int,bool,int)
Spine.Unity.MeshGenerator:FillTriangles (UnityEngine.Mesh) (at Assets/Spine/Runtime/spine-unity/Mesh Generation/MeshGenerator.cs:1282)
Spine.Unity.SkeletonPartsRenderer:RenderParts (Spine.ExposedList`1<Spine.Unity.SubmeshInstruction>,int,int) (at Assets/Spine/Runtime/spine-unity/Components/SkeletonRenderSeparator/SkeletonPartsRenderer.cs:126)
Spine.Unity.SkeletonRenderSeparator:HandleRender (Spine.Unity.SkeletonRendererInstruction) (at Assets/Spine/Runtime/spine-unity/Components/SkeletonRenderSeparator/SkeletonRenderSeparator.cs:273)
Spine.Unity.SkeletonRenderer:LateUpdateMesh () (at Assets/Spine/Runtime/spine-unity/Components/SkeletonRenderer.cs:645)
Spine.Unity.SkeletonRenderer:LateUpdate () (at Assets/Spine/Runtime/spine-unity/Components/SkeletonRenderer.cs:589)
Spine.Unity.SkeletonMecanim:LateUpdate () (at Assets/Spine/Runtime/spine-unity/Components/SkeletonMecanim.cs:180)
Is this a Spine bug, a Unity bug, or a me bug?
Just something I found online that may help: Stopping a particle system often involves a cleanup process that can interact with mesh data (?), potentially triggering the error if the mesh data is not in a valid state (?).