예제 #1
0
            private static void CheckUsedUpdate()
            {
                var markFile = AssetsUsageChecker.GetMarkFile();

                if (File.Exists(markFile))
                {
                    if (!APCache.LoadFromLocal())
                    {
                        APCache.LoadDataIntoCache(CheckUnusedState);
                    }
                    else
                    {
                        CheckUnusedState();
                    }
                }


                if (File.Exists(AFTERBUILD_A_PLUS))
                {
                    if (APlusWindow.Instance != null &&
                        APlusWindow.Instance.webview != null &&
                        AssetNotification.webCommunicationService != null)
                    {
                        AssetNotification.webCommunicationService.RefreshAll();
                        AssetNotification.webCommunicationService.Refresh();
                        File.Delete(AFTERBUILD_A_PLUS);
                    }
                }
            }
예제 #2
0
            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);
                        }
                    }
                }
            }
예제 #3
0
            static PrepareOnLoad()
            {
                Utility.DebugLog("Executing PrepareOnLoad");
                webCommunicationService           = ScriptableObject.CreateInstance <WebViewCommunicationService>();
                webCommunicationService.hideFlags = HideFlags.HideAndDontSave;

                EditorApplication.update += BackgroundUpdate;
                EditorApplication.playmodeStateChanged += PlaymodeStateChanged;

                time = EditorApplication.timeSinceStartup;
                bool hasLoadFromLocalKey = EditorPrefs.HasKey(APCache.LOAD_FROM_LOCAL_KEY);


                if (PreferencesItems.AutoRefreshCacheOnProjectLoad)
                {
                    APCache.LoadDataIntoCache(CheckUnusedState);
                }
                else
                {
                    if (hasLoadFromLocalKey ||
                        EditorApplication.isPlayingOrWillChangePlaymode ||
                        EditorApplication.isCompiling)
                    {
                        if (!APCache.LoadFromLocal())
                        {
                            APCache.LoadDataIntoCache(CheckUnusedState);
                        }
                        else
                        {
                            CheckUnusedState();
                        }
                    }
                    else
                    {
                        if (!APCache.LoadFromLocal())
                        {
                            APCache.LoadDataIntoCache(CheckUnusedState);
                        }
                    }
                }
            }