Hey guys, I am using 2017.4.17f1, and any time I change even one line of code and compile, my compile times are literally 10 minutes every time I hit play. Is this a known issue with this unity version? Thanks!
Hey, how big is your project in terms of classes count? Can you split it with assembly definitions in Unity 2017?
I’m going to look into doing this, thank you for the suggestion!
Hey so if I put all scripts that I am not working on in the Standard Assets folder, and whatever script that I am currently editing and recompiling over and over outside of Standard Assets, will that reduce compile time? Because right now I have a lot of scripts outside of Standard Assets and was just reading about the compile order and this seems like a bad idea how I have this setup. Thanks!
Yes, the compile times have gotten noticeably longer overall and in a large project this will become exceedingly noticeable. As disturbedUKR suggested, Assembly Definitions are probably your best bet for dealing with this. I’ve been using them to great effect to reduce my compile times from 3-5 minutes down to 15 seconds or so. However! There are serious issues you should be aware of!
-
Don’t use a lot of them. Each AsmDef you create will cause a new assembly and associated DLL to be generated. If you have lots of these your compile time may be reduced but the time needed to unload and reload the assemblies will start to overtake your savings. I tend to use only a handful of AsmDefs. One for 3rd party assets, one for my long-term library code, and one or two for my current project.
-
Magic folders are ignored when included by an AsmDef! This means things like ‘Editor’ folders have no meaning to the compiler and will be compiled as normal. While you could possibly add a seperate AsmDef for editor-only compilation that can be a huge undertaking! Worse yet, you’re back to the issue of potentially having dozens or even hundreds of assemblies! Clearly an automated approach is the best for now. There is a post about this issue here that provides some suggestions and a link to an automated tool that may-or-may not work for your version of Unity.
You can try putting your long-term code into a folder called Standard Assets. I’ve done this in the past and it can help. But lot of things will trigger it to recompile and in general it’s more of a hack than a real solution. It might not even work on newer versions of Unity and will likely be completely removed at some point in favor of Assembly Definitions.
Thanks for the detailed info! I’m going to try the standard assets thing in the short term, and try and set up Assembly Definitiions for a more complete solution, thank you both very much!