- Home /
Unity Re-compiles on Play
When pressing the Play button in the Unity Editor a recompile is triggered. Any idea why this might happen?
Things I have considered causing the issue:
- An editor script that I have that triggers a project save on run
Removing it does not prevent the issues, beside recompile would happen despite having no modifications to save
- Version control system I use (Perforce)
Does not cause issues on my other computer, so its unlikely
- An alternative editor script causing a re-import
I have done a search for AssetDatabase.ImportAsset and AssetDatabase.Refresh but have found nothing
I have created an empty project trying to reproduce the issue however in a new project I cannot get it to occur.
Answer by AtticusMarkane · Oct 22, 2018 at 01:54 AM
After further research I found out the offending code was in UnityAdsBuildProcessor. OnPostprocessScene would get called and for some reason the following code triggered a recompile.
As for why it happens on one computer and not the other: Its possible its because my main computer has Unity pro setup on it and my secondary computer that I don't use often only runs the free version.
[PostProcessScene]
public static void OnPostprocessScene()
{
AdvertisementSettings.enabled = true;
AdvertisementSettings.initializeOnStartup = false;
}
Your answer
Follow this Question
Related Questions
Unity internal error in Playtest mode. What is the cause and how do I prevent it?? 0 Answers
After compiling game lags 0 Answers
Why do imported assets turn into an error file when I import something from Maya 2017 to Unity? 0 Answers
UnityEditor Pre-compliler Defines for differentiating between Windows & Mac OSX 1 Answer