Hi !
As a quite common scenario, i'm working on a project with an increasing number of scripts.
After the last few days, I noticed a sensible increase in script recompilation times: it takes almost 20 seconds instead of what used to be, like 3.
I've been reading here and there about how C# or building my code into a DLL compiles much faster, but, rather than speeding it up, i'm trying to *understand why* this happens, ,so I'd like to narrow down what could just be some awful code.
I'd like to write an helper script, to measure individual scripts recompiling times and find the bad guy.
I'm reading AssetDatabase docs, but doesn't seam the right place for what i'm trying to do.
//something like this
function OnRecompilation()
{
var time_break = Time.realtimeSinceStartup;
var measured_script = every script triggered to be compiled ? how ? :)
AssetDatabase.Refresh(); //obviously not, but you get the idea. do you ? :)
print(measured_script + " Loaded in " + (Time.realtimeSinceStartup-time_break));
}
Of course, given the growing number of scripts, including a "self compilation time measuring" function to all of them, is not an option.
Also, Is there anything else beyond scripts, (Substances in Resources folder) affecting what i may wrongly call "recompilation times" (the small lower right circle) ? Moving substances away from that folder didn't help, but at the moment i'm clueless.
Thanks for your time and attention :)
↧