Nate

We've modularzed our spine-ts runtime and made it available on the NPM registry. This means it's very easy to use spine-ts in your web and JavaScript projects: spine-ts core, WebGL, HTML canvas, three.js, and the Spine Web Player.

Read more about it in our latest blog post:
Blog: Spine goes NPM

User avatar
Nate

Nate
  • Posts: 11386

HyperSSam

Awesome, any chance of having something similar for the Unity runtime? Unity supports NPM packages and can be installed via the Package Manager, there are actually several Unity packages available there such as:

https://www.npmjs.com/package/com.stansassets.foundation
https://www.npmjs.com/package/com.fluid.behavior-tree

The downside is that the package manager was introduced in Unity 2018 so older versions would still need the .unitypackage:
https://forum.unity.com/threads/new-to-unity-2018-1-package-manager.521006/
User avatar
HyperSSam
  • Posts: 31

Mario

I had a quick look at the NPM support Unity has. I see two issues. Firstly, they don't support scoped packages. Secondly, they don't support ramges in dependency versions. That'd mean we'd have to publish a package for each Unity version we support. That's not great. NuGet is likely a better option.
User avatar
Mario

Mario
  • Posts: 2721

martinr

Any chance you could provide minified versions as well? We are currently not using a bundler, so having it minified is essential for us. Something like @esotericsoftware/spine-core-min would be awesome.
martinr
  • Posts: 29

HyperSSam

Thanks for the reply @Mario, I'm a bit confused about needing to publish a package for each supported Unity version, when downloading the spine runtimes from http://esotericsoftware.com/spine-unity-download there is a single .unitypackage download that is compatible with Unity 2017.1-2021.1, why would different packages be needed if published to NPM?

NuGet sounds good, but as far as I know Unity package manager has no support for NuGet packages yet.
User avatar
HyperSSam
  • Posts: 31

Mario

martinr, the package contains minified versions as per the README.md https://github.com/EsotericSoftware/spine-runtimes/tree/4.0/spine-ts#usage-in-vanilla-javascript

hypersam: the package.json of our package would need to specify dependency versions, including for Unity packages. UPM only ignores the version of core packages, but not of packages outside core. At least according to their docs. I'm likely wrong. Anyways, we have decided to publish spine-unity and spine-csharp to NPM as well!
User avatar
Mario

Mario
  • Posts: 2721

HyperSSam

@Mario I see, actually I think you are correct about the core packages, looking at the docs it seems they are bound to the Unity Editor version https://docs.unity3d.com/Manual/pack-core.html so maybe they won't need to be specified in the package.json, at least Unity doesn't seem to do so in some of their non-core packages, like in URP for example: https://github.com/Unity-Technologies/Graphics/blob/master/com.unity.render-pipelines.universal/package.json

That's awesome, I'll be looking forward at them, thank you very much!
User avatar
HyperSSam
  • Posts: 31


Return to Spine