Some things that I found out:
First I could not reproduce the problem in Unity 2018.3.0f1, then upgraded to f2 and instantly could! Maybe related to the unity version and either some implicit behaviour change, or a bug in a Unity version - maybe you could test that with different Unity versions?
I can confirm that the shader or material is not null. After some time I got this error message, but no wrong Sprite (at least I did not see any).
Assertion failed on expression: '!m_CoroutineEnumeratorGCHandle.HasTarget()'
UnityEngine.Coroutine:Finalize()
One more very interesting thing: I just closed unity and reopened it - et voila, the problem occurred instantly in the first 10 attachments (or the very first? don't know), but only if I don't attach the debugger (so it's definitely a timing issue..)!
I found the cause!
The problem is with your 4 movement directions having SpineAnimations for each direction, but all start disabled and having no Material assigned (maybe that is cleared by unity upon save? I don't know) except for the FrontAnimation
version - then you have to pick up one of your spritelings before they turned in all directions and throw them at a target resource, then when the method attachSpriteToSkeleton()
below is called, the _mesh
for the disabled directions has no materials assigned in the inspector and will get the default material assigned implicitly upon calling the method:

You can add the following code to trap the error case:
in BAgentAnimator.cs:
void attachSpriteToSkeleton(SkeletonAnimation _skelAnim, MeshRenderer _mesh, Slot _slot, Sprite _sprite)
{
// Add this on top of the method to catch the problem case:
if (!_mesh.material.shader.name.Contains("Spine"))
Debug.LogError("shader with different name found!" + _mesh.material.shader.name);
So long story short: You have to make sure that the material gets either saved or is assigned properly before attaching the Sprite.
I noticed that the material is cleared by the SkeletonAnimation
when the MeshRenderer
is deactivated. Since this is undesired behaviour, I have quickly fixed it. So you should be able to update the Spine unitypackage and enable and then again disable your MeshRenderers, then all material references should be restored and kept intact, then apply you prefabs again.
You can download the latest unitypackage here as usual:
Spine Unity Download
Please let me know if this solved your problem.