Beispiel #1
0
        public static void CopyStreamingToRes()
        {
            FileUtilTool.DeleteFolder("Assets/StreamingAssets/assetbundles");
            FileUtilTool.DelFile("Assets/StreamingAssets/assetrecord.dat");
            FileUtilTool.DelFile("Assets/StreamingAssets/MD.dat");
            FileUtilTool.DelFile("Assets/StreamingAssets/MD2.dat");
            FileUtilTool.DelFile("Assets/StreamingAssets/fullApkIdentify");

            FileUtilTool.DeleteFolder("Assets/StreamingAssets/Audio/GeneratedSoundBanks/Windows");
            FileUtilTool.DeleteFolder("Assets/StreamingAssets/Audio/GeneratedSoundBanks/Android");
            FileUtilTool.DeleteFolder("Assets/StreamingAssets/Audio/GeneratedSoundBanks/Android_Original");
            FileUtilTool.DeleteFolder("Assets/StreamingAssets/Audio/GeneratedSoundBanks/iOS");
            FileUtilTool.DeleteFolder("Assets/StreamingAssets/Audio/GeneratedSoundBanks/iOS_Original");
            //        #if UNITY_ANDROID
            ////		FileUtilTool.CopyFolder("WwiseProjects/OutPath/Android_Original", "Assets/StreamingAssets/Audio/GeneratedSoundBanks/Android_Original");
            //        FileUtilTool.CopyFolder("WwiseProjects/OutPath/Android", "Assets/StreamingAssets/Audio/GeneratedSoundBanks/Android");
            //        #elif UNITY_IOS
            ////		FileUtilTool.CopyFolder("WwiseProjects/OutPath/iOS_Original", "Assets/StreamingAssets/Audio/GeneratedSoundBanks/iOS_Original");
            //        FileUtilTool.CopyFolder("WwiseProjects/OutPath/iOS", "Assets/StreamingAssets/Audio/GeneratedSoundBanks/iOS");
            //        #endif

            //#if UNITY_ANDROID
            //		FileUtilTool.DeleteFolder("Assets/StreamingAssets/Audio/GeneratedSoundBanks/Android");
            //		FileUtilTool.DeleteFolder("Assets/StreamingAssets/Audio/GeneratedSoundBanks/iOS_Original");
            //		FileUtilTool.DeleteFolder("Assets/StreamingAssets/Audio/GeneratedSoundBanks/iOS");
            //		FileUtilTool.DeleteFolder("Assets/StreamingAssets/Audio/GeneratedSoundBanks/Windows");
            //#elif UNITY_IOS
            //        FileUtilTool.DeleteFolder("Assets/StreamingAssets/Audio/GeneratedSoundBanks/Windows");
            //        FileUtilTool.DeleteFolder("Assets/StreamingAssets/Audio/GeneratedSoundBanks/Android");
            //		FileUtilTool.DeleteFolder("Assets/StreamingAssets/Audio/GeneratedSoundBanks/iOS");
            //		FileUtilTool.DeleteFolder("Assets/StreamingAssets/Audio/GeneratedSoundBanks/Android_Original");
            //#else
            //		FileUtilTool.DeleteFolder("Assets/StreamingAssets/Audio/GeneratedSoundBanks/Android_Original");
            //        FileUtilTool.DeleteFolder("Assets/StreamingAssets/Audio/GeneratedSoundBanks/Android");
            //		FileUtilTool.DeleteFolder("Assets/StreamingAssets/Audio/GeneratedSoundBanks/iOS");
            //		FileUtilTool.DeleteFolder("Assets/StreamingAssets/Audio/GeneratedSoundBanks/iOS_Original");
            //#endif

            FileUtilTool.CopyFolder(FileUtils.StreamingPath(), ResSetting.build_res_path);
            FileUtilTool.CopyFolder(ResSetting.build_ab_path, ResSetting.build_res_path + "/assetbundles");
            BuildAssetBundleTool.DeleteMainfestFile(ResSetting.build_res_path);
            ClearFileWithExtension(ResSetting.build_res_path, ".meta");

            //加密资源
            ResTool.GenEncrypt();
            ResTool.GenMD5();
            ResTool.GenMD5Second();
        }
Beispiel #2
0
        /// <summary>
        /// 生成本地资源不包括加密
        /// </summary>
        public static void BuildLocalRes()
        {
            try
            {
                BuildTool.buildLog.First();

                MarkTool.ClearMarkForce();

                BuildTool.buildLog.Next();

                MarkTool.GenRecord();

                BuildTool.buildLog.Next();

                MarkTool.MarkAutoFromRecord();

                BuildTool.buildLog.Next();

                BuildAssetBundleTool.BuildAssetBundles();

                BuildTool.buildLog.Next();

                MarkTool.ClearAutoFromRecord();

                BuildTool.buildLog.Next();

                //BuildAssetBundleTool.DeleteMainfestFile();

                BuildTool.buildLog.Next();

                ResTool.CompressAssetBundle();

                BuildTool.buildLog.Next();

                ResTool.CopyStreamingToRes();

                BuildTool.buildLog.End();
                BuildTool.SaveBuildLog(BuildTool.buildLog);
            }

            catch (System.Exception e)
            {
                BuildTool.buildLog.errorLog = e.ToString();
                BuildTool.SaveBuildLog(BuildTool.buildLog);
                Debug.LogError(e);
            }
        }