Hi there!
I never quite gave up hope on not having to compile AC every time I update my code, and I thought that the new packages in unity could be just what the doctor called for (after failing to compile AC into a DLL and noting that the Plugins model doesn't do the trick). I have been able to convert every asset my project use to a package except for AC, but it's ALMOST there.
I wanted to let anyone else who's looking to trim down compilation and build times to know what I did to see if perhaps someone can help me push it all the way, (or maybe there's even support for this coming from Chris in the future?):
Anyway, here's what I did:
1. Moved the AdventureCreator folder from Assets to packages
Created a (super non-official) package.json in the AC folder:
{
"name": "com.adventurecreator",
"displayName": "Adventure Creator",
"version": "1.71.8",
"dependencies": {
"com.unity.timeline": "1.3.5",
"com.unity.textmeshpro": "3.0.1"
}
}
Created an AdventureCreator.asmdef in the AC folder:
{
"name": "AdventureCreator",
"references": [
"Unity.Timeline",
"Unity.TextMeshPro"
],
"includePlatforms": [],
"excludePlatforms": []
}
This actually compiles but I'm getting a lot of errors when it comes to referencing icons. It may well be that the only thing left to do to get this working is to sort out path issues inside of Resource.cs (which contains references to the "Assets" folder).
Any help in getting this working would be greatly appreciated! 👍
It looks like you're new here. If you want to get involved, click one of these buttons!
Comments
You would need to modify Resource.cs to suit your needs, but such assets are referenced using AssetDatabase.LoadAssetAtPath - I'm not sure what the Package folder equivalent would be.
Have you seen the note about moving to a Plugins folder in the Manual's "Performance and optimisation" chapter? That should prevent re-compilation when editing your own scripts.
I have put a crazy amount of hours into both the DLL (which works perfectly), Plugins and the .asmdef methods (which technically saves time during VS compilations but in reality the gains are irrelevant because as soon as you switch over to Unity and it notices that you have recompiled your app, it rebuilt everything form scratch (including any content in the Plugins folder).
These Unity shortcomings have all been addressed ad nauseam on the forums, and Unity claims that the rebuild issues have been addressed in the package model (and it actually does seem to work this time 😂).
A bunch of Unity Asset are moving to the new package model and if you look at for example Spine, they have a model I think you would like: If you download their package it's automatically placed in Assets/Plugins. But they included the two files I mentioned above so that people who don't want their build times crippled can just throw the whole folder into the Packages folder instead, no code changes needed.
I definitely think loading assets is possible from both the Assets and Packages folder. And IF the system can't figure out where it's located on itself and look fore assets accordingly, maybe a checkbox in the AC project settings could tell AC which of the two installs options are used. So no code would have to be changed on updating AC.