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.

For it to work properly with the editor, assembly definition required that editor and runtime assemblies are kept in completely separate folders.

So in Spine-Unity for Spine 3.7 (currently in beta), we have organized it like this:
A folder called "Runtime" contains both spine-unity and spine-csharp folders.
These share one asmdef named "spine-unity".

A folder named "Editor" contains all the editor folders, and mirror their original folders.
This is defined as an asmdef named "spine-unity-editor".

Unity_2018-07-18_05-42-00.png


This change was not applied to Spine-Unity for Spine 3.6 as the folder change may break some people's projects. We typically reserve these major changes to new versions of Spine.
User avatar
Pharan

Pharan
Posts: 5173

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

thsbrown

I went ahead and tried to implement the asmdef file given the instruction in the first post. Threw a bunch of errors on build. Is there something i'm doing wrong?
thsbrown
Posts: 18

Pharan

Sorry for the misunderstanding. The original post was inaccurate. I'll update the information.

The asmdef files actually required a major reorganizing of the Spine-Unity asset folders.
This has been done in spine-unity for Spine 3.7 beta and it currently works fine.

For now, 3.6 can't be used with asmdef files without putting all the editor special folders into its own folder and giving it its own asmdef marked "Editor".

You should be able to do this yourself. Just follow the organization described above, or download Spine-Unity for Spine 3.7 and see how things are organized. There are no new features to be added in 3.6 so you should be fine doing this in your own project. Updating your project's Spine-Unity via unitypackage will still work because Unity detects individual files' guids when updating, even if they're moved to different folders.

The other option is to remove all your asmdef files when you build. But that may be very inconvenient depending on your setup.
User avatar
Pharan

Pharan
Posts: 5173

thsbrown

Not a problem, went ahead and grabbed the 3.7-beta files from github and pulled those in.
thsbrown
Posts: 18


Return to Unity