static PrepareOnLoad() { Utility.DebugLog("Executing PrepareOnLoad"); webCommunicationService = ScriptableObject.CreateInstance <WebViewCommunicationService>(); webCommunicationService.hideFlags = HideFlags.HideAndDontSave; EditorApplication.update -= BackgroundUpdate; EditorApplication.update -= CheckUsedUpdate; EditorApplication.update += BackgroundUpdate; EditorApplication.update += CheckUsedUpdate; #if UNITY_2017_1_OR_NEWER EditorApplication.playModeStateChanged += e => { PlaymodeStateChanged(); }; #else EditorApplication.playmodeStateChanged += PlaymodeStateChanged; #endif time = EditorApplication.timeSinceStartup; // Load black list data form local file APCache.LoadBlacklist(); if (PreferencesItems.AutoRefreshCacheOnProjectLoad) { APCache.LoadDataIntoCache(CheckUnusedState); } else { if (EditorApplication.isPlayingOrWillChangePlaymode || EditorApplication.isCompiling) { if (!APCache.LoadFromLocal()) { APCache.LoadDataIntoCache(CheckUnusedState); } else { CheckUnusedState(); } } else { if (!APCache.LoadFromLocal()) { APCache.LoadDataIntoCache(CheckUnusedState); } } } }