Exemplo n.º 1
0
        /// <summary>
        /// Builds the asset bundles update A.
        /// </summary>
        public static void buildAssetBundlesUpdateAB()
        {
            EditorUtility.DisplayProgressBar("Generate FileList", "loading bundle manifest", 1 / 2);
            AssetDatabase.Refresh();
            string        readPath = EditorUtils.GetFileStreamingOutAssetsPath(); // 读取Streaming目录
            var           u3dList  = EditorUtils.getAllChildFiles(readPath, @"\.meta$|\.manifest$|\.DS_Store$|\.u$", null, false);
            List <string> assets   = new List <string> ();

            foreach (var s in u3dList)
            {
                string ab = EditorUtils.GetAssetPath(s);  //s.Replace(readPath, "").Replace("/", "").Replace("\\", "");
                assets.Add(ab);
            }

            readPath = new System.IO.DirectoryInfo(EditorUtils.GetLuaBytesResourcesPath()).FullName;   // 读取lua 目录
            u3dList  = EditorUtils.getAllChildFiles(readPath, @"\.bytes$", null);
            foreach (var s in u3dList)
            {
                string ab = EditorUtils.GetAssetPath(s);  //s.Replace(readPath, "").Replace("/", "").Replace("\\", "");
                assets.Add(ab);
            }

            EditorUtility.ClearProgressBar();
            CUtils.DebugCastTime("Time Generate FileList End");
            Debug.Log("all assetbundle count = " + assets.Count);
            BuildScript.GenerateAssetBundlesUpdateFile(assets.ToArray());
            CUtils.DebugCastTime("Time GenerateAssetBundlesUpdateFile End");
        }
Exemplo n.º 2
0
        /// <summary>
        /// 检查输出目标
        /// </summary>
        public static void CheckstreamingAssetsPath()
        {
            string dircAssert = EditorUtils.GetFileStreamingOutAssetsPath();

            if (!Directory.Exists(dircAssert))
            {
                Directory.CreateDirectory(dircAssert);
            }

            Debug.Log(string.Format("current BuildTarget ={0},path = {1} ", CUtils.platform, dircAssert));
        }