Exemple #1
0
        public static void DeleteAssetBundlesName()
        {
            string        assetBundleName = "";
            List <ABInfo> del             = new List <ABInfo>();

            Object[] selection = Selection.objects; //EditorUtils.SelectObjects();

            foreach (Object s in selection)
            {
                string abPath = AssetDatabase.GetAssetPath(s);
                string folder = EditorUtils.GetLabelsByPath(abPath);
                string name   = CUtils.GetRightFileName(s.name.ToLower());

                if (string.IsNullOrEmpty(folder))
                {
                    assetBundleName = name + "." + Common.ASSETBUNDLE_SUFFIX;
                }
                else
                {
                    assetBundleName = string.Format("{0}/{1}.{2}", folder, name, Common.ASSETBUNDLE_SUFFIX);
                }

                if (s.name.Contains(" "))
                {
                    Debug.LogWarning(s.name + " contains space");
                }
                Debug.Log("delete : " + s.name + " md5 = " + assetBundleName);
                del.Add(new ABInfo(assetBundleName, 0, 0, 0));
            }

            SplitPackage.DeleteStreamingFiles(del); //删除选中对象的ab
        }
Exemple #2
0
        public static void BuildAssetBundles()
        {
            CUtils.DebugCastTime("Time HandleUpdateMaterail End");
            EditorUtils.CheckstreamingAssetsPath();
            CUtils.DebugCastTime("Time CheckstreamingAssetsPath End");
            var ab = BuildPipeline.BuildAssetBundles(EditorUtils.GetOutPutPath(), SplitPackage.DefaultBuildAssetBundleOptions, target);

            SplitPackage.CreateStreamingFileManifest(ab);
            CUtils.DebugCastTime("Time BuildPipeline.BuildAssetBundles End");
        }