Scripts start to compile when play mode starts

Hi,

with version 5.4 i have this really weird bug where as soon as i hit play in the editor unity starts to compile scripts. This results in all sorts of errors. Is this behavior cause by a script calling unity to compile on play or is it a new bug with 5.4? I never encountered anything like it.

Ok, i’ve found out what caused this. It seems to be this code which i disabled now via #if statements:

using UnityEditor;
using UnityEditor.Callbacks;
using UnityEditor.Advertisements;

public class UnityAdsBuildProcessor : Editor
{
	#if !UNITY_EDITOR

	[PostProcessScene]
	public static void OnPostprocessScene ()
	{
		AdvertisementSettings.enabled = true;
		AdvertisementSettings.initializeOnStartup = false;
	}

	#endif
}