Ligamen

Runtimes

Unity runtime

Ligamen Unity Runtime is the package that plays skeletal animation in Unity. It reads skeletons exported from Ligamen Studio and Spine 4.0–4.3 in JSON or binary form, imports their atlases, and renders them in a Scene or a Canvas. The package is a separate implementation: it contains no spine-csharp or spine-unity code, uses Ligamen.* assemblies and namespaces, and can coexist with the official spine-unity package in one project.

Version 1.0.1 is feature-complete against spine-unity 4.3. The same runtime and data model handle every supported format version. Pose, mesh and Unity component behavior are checked against the official 4.0–4.3 runtimes in Unity batchmode test labs. This page contains the complete practical reference: installation, import, components, scripting API, measured performance and licensing.

Export from Ligamen Studio#

Open File → Export…, choose Data, and export either Standard JSON or Binary data. A binary export should use the .skel.bytes extension. Turn on Texture atlas so the skeleton, <name>.atlas.txt and all atlas page PNGs are written together. Choose Spine 4.0, 4.1, 4.2 or 4.3 as the output profile; the runtime reads both Ligamen Studio and Spine exports of those versions. See Export and Texture packing for all editor options.

Copy the data file, atlas text file and PNG pages into one folder under the Unity project's Assets/. Do not rename only one member of the set: atlas page names and file references must still match.

Install the package#

In Unity Package Manager choose Add package from git URL and enter:

https://github.com/ligamenstudio/ligamen-unity.git

Append #<tag> to pin a release. You can also use Add package from disk with package.json from a local clone, or add this dependency to Packages/manifest.json:

"com.ligamen.unity": "https://github.com/ligamenstudio/ligamen-unity.git"

The minimum supported Unity version is 2018.3. The package is tested on Unity 6000.3.1f1 with the Built-in Render Pipeline, URP 17.3 and HDRP 17.3.

Formats, features and assemblies#

The runtime detects Spine 4.0, 4.1, 4.2 and 4.3 JSON and binary data. The patch number does not affect JSON compatibility; binary files are read by a reader for the same major and minor version. Atlases may use multiple pages, premultiplied alpha or straight alpha.

Supported pose data includes bones, slots, skins, regions, meshes, linked meshes, clipping, bounding boxes, paths, points and sequences. It evaluates IK, transform, path, physics and slider constraints, animation mixing, additive tracks, events, deform and sequence timelines, draw order, and attachment and draw-order thresholds according to the selected format version.

AssemblyPurpose
Ligamen.CoreFormats, data model, pose and animation; no UnityEngine references
Ligamen.UnityAssets, Scene components and rendering
Ligamen.Unity.UICanvas component; enabled with com.unity.ugui
Ligamen.Unity.EditorImporter, inspectors and editor tools
Ligamen.Unity.TimelineTimeline tracks and clips; enabled with com.unity.timeline

Import a skeleton#

Select the .json or .skel.bytes file in the Project window and choose Assets → Ligamen → Import Skeleton. The importer creates <skeleton>_LigamenSkeletonData.asset, <atlas>_LigamenAtlas.asset, and one <atlas>_<page>_LigamenMaterial.mat per atlas page. Reimport updates these assets in place. If validation fails, the Console identifies the problem and the importer writes nothing.

Assets → Ligamen → Automatic Import watches new skeleton files. It is enabled by default only when spine-unity is not installed, so two importers do not compete for the same files.

Scene and Canvas playback#

For a regular GameObject add Ligamen → Ligamen Skeleton Animation, assign the skeleton data asset, then choose a skin and animation in the inspector. The component renders through MeshRenderer. From C# you can use:

var player = GetComponent<LigamenSkeletonAnimation>();
player.AnimationName = "run";
player.AnimationState.SetAnimation(0, "run", true);
var skeleton = player.Skeleton;

AnimationName is convenient for a single looping animation. AnimationState exposes tracks, queues, mixing, additive playback and events. Skeleton provides the live bones, slots, attachments and constraints.

Inside a Canvas add Ligamen Skeleton Graphic; it requires com.unity.ugui and follows the same inspector and playback API. Unity masks and CanvasGroup work normally. Multi-page atlases are drawn through hidden child canvas renderers.

Animator and Timeline#

For Mecanim, select the skeleton data asset and choose Assets → Ligamen → Generate Mecanim Controller. The command creates one wrapper clip per skeleton animation. Build states in the generated controller, then add Ligamen Skeleton Mecanim next to Ligamen Skeleton Animation; an Animator is added automatically. Layers support Auto Reset and a custom MixMode. In Edit Mode, enabling Preview in the Animation window lets you scrub a wrapper clip for Scene and Canvas skeletons.

With com.unity.timeline installed, create a Ligamen Animation State Track, bind it to Ligamen Skeleton Animation, and place Ligamen Animation State Clip items on it. Clips expose the animation name, loop, mix settings, Don't End with Clip, end mix duration, thresholds and alpha. Editor scrubbing poses the skeleton. Use Ligamen Animation State Graphic Track for a Canvas and Ligamen Skeleton Flip Track to flip X or Y while clips are active.

Events, audio and scene integration#

Add Ligamen Animation Events beside a Scene or Canvas component to receive UnityEvents for skeleton events and track start, complete and end. Audio events play the clip associated with their audio path; Find Audio Clips in the component context menu binds clips by file name.

Ligamen Skeleton Root Motion moves a GameObject, Rigidbody2D or Rigidbody from the animated translation of the root bone. Mecanim uses Ligamen Skeleton Mecanim Root Motion. Ligamen Bone Follower, Point Follower and Bounding Box Follower keep GameObjects on a bone, point attachment or bounding box; Graphic variants work in a Canvas. Bounding box followers can create polygon colliders per attachment.

Ligamen Skeleton Utility creates a GameObject hierarchy for bones. Utility bones can Follow the skeleton or Override it with a mix, and custom utility constraints derive from LigamenSkeletonUtilityConstraint.

Physics and rendering#

Physics constraints from Spine 4.2 and later update inside the playback components. Ligamen Physics Movement makes them respond to movement and rotation of the GameObject. Ligamen Studio's per-animation Warm Up is editor-only and is not stored in Spine 4.2/4.3 JSON or binary data. The export therefore warns about it and the Unity runtime starts native physics cold. If the first visible pose must be settled, advance the animation before showing the skeleton or export physics baked to a 4.0/4.1 profile.

Ligamen/Skeleton and Ligamen/SkeletonGraphic shaders support Built-in, URP and HDRP, premultiplied and straight alpha, tint black and blend-mode materials. Separator slots can split a Scene skeleton into child part renderers, matching the common spine-unity workflow.

Scripting API and diagnostics#

Use SpineVersion.Detect(bytes) from Ligamen.Core to identify JSON or binary data. It returns the full version, the 4.0–4.3 profile and the format. Version-specific readers such as SkeletonJson43.Read(text) and SkeletonBinary43.Read(bytes) produce the shared SkeletonData model. Other profiles use SkeletonJson40–42 and SkeletonBinary40–42.

Malformed data throws LigamenFormatException with the location of the error; unsupported versions throw UnsupportedSpineVersionException. The model exposes bones, slots, skins, attachments, events, constraints and animation timelines. Ligamen.Core targets netstandard2.0, uses C# 7.3, has no engine references and can be tested outside Unity.

Performance#

The package is measured against spine-unity 4.3 on identical data. Across spineboy, raptor and Kuzya, Scene, Canvas, Mecanim and Timeline frame time in the Unity Editor is typically 0.71–0.98× spine-unity, where a value below 1.00 is faster. In non-development IL2CPP players the Scene cases measured 0.76–0.91×. Both runtimes allocate zero managed memory per frame after warm-up.

A synthetic physrig stress test with many tiny quads and physics is 1.15–1.20× slower under Mono, but 0.91–0.96× under IL2CPP. This is a documented stress case rather than the result on typical rigs.

License#

Ligamen Unity Runtime is source-available, not open source. You may use, modify and ship it inside your own games and applications. Using the runtime does not require a Ligamen Studio editor license. Content created or edited with Ligamen Studio remains subject to the editor edition's terms; third-party or Spine content does not require an editor license merely because this runtime plays it.

You may not redistribute the runtime as a standalone package or use it as the basis of a competing animation tool, and copyright and license notices must remain. Other tools and content keep their own licenses. English is the governing text under the laws of England and Wales, with disputes resolved by SIAC arbitration in Singapore. Read the complete Ligamen Unity Runtime License Agreement or its Russian translation.