My current Unity project now has build times at around 4 hours (!!!). I had previously assumed by computer was underpowered or short of memory, but having just upgraded the machine I’ve seen little improvement.
Research on the internet suggests that scripts with non-private fields can cause problems, so I’ve been through my entire source base (over 1MB of code!) making as many things private as possible. Unfortunately that’s had nowhere near enough impact. Most classes still have 3-5 public variables and the scale of the refactoring job needed to remove them would be vast (many weeks of work, at minimum). Even if I did, they’d only be replaced with public functions, which presumably isn’t much better?
What can I do about this? I need to get my build times down since I’m approaching alpha release for the project and need to be able to iterate builds quickly. Or, failing that, at least not have to literally do them overnight!