Pharan

Now that Unity 2017.3 is out, and if you're upgrading your project, you will probably want to use the new Assembly Definition files feature to minimize recompile times while you are coding on your project.

The next unitypackage update will have this asmdef file included in the Spine folder.
However, updating your fairly old project in Unity 2017.3 may cause some things to break if your folders weren't arranged correctly. Just follow the recommended folder arrangement and it should work fine again.

To use it with Spine, you only need to have a "Spine-Unity" Assembly Definition (asmdef) file in your folder that contains both spine-csharp and spine-unity.
If you installed the spine-unity unitypackage recently, both spine-csharp and spine-unity should already be in a folder named "Spine". That's where you should create your Spine-Unity.asmdef file.

Otherwise, if your project didn't have that enclosing Spine folder, you need to create that Spine folder and place your spine-unity and spine-csharp folders in it. Then add the Spine-Unity.asmdef file there accordingly.

Unity_2017-12-20_07-24-43.png


Make sure you move your folders around in Unity and not in your OS to keep your folder guids intact.

- For Unity 2017.2 projects and older, the addition of the asmdef file shouldn't affect you except that it adds the unused/unrecognized file to your project assets folder.

- If you are using your own assembly definition files for your scripts and need to use Spine classes, don't forget to add the Spine-Unity.asmdef file to the References list in your assembly definition file's inspector.

- For the past few years, we have been changing our recommendations in our sample scripts of Spine API access from directly accessing fields to accessing them through the public properties. If you have been directly accessing internal fields, using Assembly Definition files may cause your script to break until you switch over to using the public properties.

- If you want to add code that adds deeply integrated functionality to Spine-Unity or need access to internal fields, our recommendation is to put your scripts in a new folder within that enclosing "Spine" folder mentioned above, so it will be treated as part of that assembly. You can name that folder something like: "spine-unity-yourprojectname".

- This single Spine-Unity assembly scheme keeps it simple to set up. If you want a more complex assembly setup, it should be as simple as removing the Spine-Unity.asmdef file and setting it up with your own. Other schemes are also possible. See Unity's blog post about it for details: https://blogs.unity3d.com/2017/11/22/unity-2017-3b-feature-preview-assembly-definition-files-and-transform-tool/
User avatar
Pharan

Pharan
Posts: 4668

inikitin

I am currently experimenting with manually adding Assembly Definition Files to our external assets, and would like to ask — no matter whether you decide to add assembly definitions officially or not, could you please group all Editor scripts together in one Editor folder, rather than having several Editor spread across the hierarchy?

Editor scripts have to be in a separate assembly, and by organizing them all in a single folder, users can just simply create two Assembly Definition files, one for Editor, another for the rest of the asset and be done with it.
inikitin
Posts: 3

Pharan

Hello!
Just an update. Now that Unity 2017.3 is out, and if you're upgrading your project, you will probably want to use the new Assembly Definition files feature to minimize recompile times while you are coding on your project.

See the edited first post above for more info.
User avatar
Pharan

Pharan
Posts: 4668


Return to Unity