Example #1
0
        public static void Clear()
        {
            if (assetBundleFileInfos != null)
            {
                assetBundleFileInfos.Clear();
                assetBundleFileInfos = null;
            }
            if (assetFileInfos != null)
            {
                assetFileInfos.Clear();
                assetFileInfos = null;
            }
            s_AnalyzeScene = null;

#if UNITY_5 || UNITY_5_3_OR_NEWER
            EditorUtility.UnloadUnusedAssetsImmediate();
#endif
            System.GC.Collect();
        }
Example #2
0
        public static bool Analyze(string directoryPath)
        {
            if (!Directory.Exists(directoryPath))
            {
                Debug.LogErrorFormat("{0} is not exists!", directoryPath);
                return(false);
            }

            assetBundleFileInfos = analyzeCustomDepend?.Invoke(directoryPath);

            if (assetBundleFileInfos == null)
            {
#if UNITY_5 || UNITY_5_3_OR_NEWER
                assetBundleFileInfos = AnalyzeManifestDepend(directoryPath);
#endif
            }

            if (assetBundleFileInfos == null)
            {
                assetBundleFileInfos = AnalyzAllFiles(directoryPath);
            }

            if (assetBundleFileInfos == null)
            {
                return(false);
            }

            s_AnalyzeScene = new AssetBundleFilesAnalyzeScene();
            AnalyzeBundleFiles(assetBundleFileInfos);
            s_AnalyzeScene.Analyze();

            if (!s_AnalyzeScene.IsAnalyzing())
            {
                analyzeCompletedCallback?.Invoke();
            }

            return(true);
        }