A sprite system and manager built ontop of the official spine-runtime that allows you to load/play exported Spine skeletons and animations with the Futile framework for Unity.
This is very much a work in progress. There's lots of room to improve, expand and optimize.
GSpineManager.LoadSpine("playerAvatar", "spine/player/playerJson", "spine/player/playerAtlas");
GSpineSprite sprite = new GSpineSprite("playerAvatar");
Futile.stage.AddChild(sprite);
The spine manager will load and link skeleton data to a reference name.
GSpineManager.LoadSpine("skeletonName", "pathToSpineJson", "pathToImageAtlas");
GSpineManager.LoadSpine("skeletonName", "pathToSpineJson");
Both pathToSpineJson and pathToImageAtlas are relative to the /Assets/Resources/ folder.
The image atlas needs to be loaded before any skeleton Json data is loaded, or at the same time.
skeletonName can be anything you wish and will be used to lookup skeleton data.
GSpineSprite sprite = new GSpineSprite("skeletonName");
Futile.stage.AddChild(sprite);
sprite.SetSkin("skinName");
sprite.Play("animationName", bool loop);
sprite.Queue("animationName", bool loop);
sprite.Pause();
sprite.Resume();
sprite.Stop();
sprite.SetAnimationTimeScale(1.0f);
sprite.SetAnimationMix("fromAnimationName", "toAnimationName", floatDuration);
The entire sprite can be colored as a whole or by specific slots. (alpha is supported but can cause blending artifcats with overlaping joints.)
sprite.color = Color.white;
sprite.FindSlotByName("slotName").color = Color.red;
GSpineSprite is extended from FContainer, position, rotation, scale, alpha etc are all supported.
You can flip the animation horizontally or vertically via...
sprite.flipX = true;
sprite.flipY = true;
The 2 main spine-runtime classes are exposed via...
sprite.skeleton; // the Spine.Skeleton class
sprite.animation; // the Spine.AnimationState class