Exemple #1
0
        public static void BuildIOSFull()
        {
            BuildIOSRes();
            Version v = Version.LoadVersionFromStreamingAsset();

            FileUtilTool.DeleteFolder("Assets/StreamingAssets/");

            //写入Version文件和写入fullApkIdentify文件
            Version.SaveVersion2StreamingAsset(v);

            //写入配置信息
            WriteIOSConfig();

            //拷贝除apk以外的资源
            ResTool.CopyResToStreaming();

            BuildIOSProject(v);


            AssetDatabase.Refresh();
            AssetDatabase.SaveAssets();

            //上传资源
            //ResTool.UploadRes();
        }
Exemple #2
0
        public static void BuildStandaloneRes()
        {
            FileUtilTool.CopyFile("IOS_Build/appleversion.dat", Application.streamingAssetsPath + "/appleversion.dat");
            Version v = BuildTool.versionRes;

            Version.SaveVersion2StreamingAsset(v);
            BuildTool.SwitchActiveBuildTarget(BuildTarget.StandaloneWindows64);
            ResTool.BuildLocalRes();
        }
Exemple #3
0
        public static void BuildIOSRes()
        {
            //AndroidOneKeyTool.UpdateStreaming();
            FileUtilTool.CopyFile("IOS_Build/appleversion.dat", Application.streamingAssetsPath + "/appleversion.dat");
            Version v = BuildTool.versionRes;

            //v.UpgradeLittleVersion();
            Version.SaveVersion2StreamingAsset(v);
            //AndroidOneKeyTool.CallShellCommandForVersionRes();
            BuildTool.SwitchActiveBuildTarget(BuildTarget.iOS);

            ResTool.BuildLocalRes();
        }
Exemple #4
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();
        }
Exemple #5
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);
            }
        }
Exemple #6
0
        public static void BuildApkNoGenRes()
        {
            Version v = BuildTool.versionRes;

            FileUtilTool.DeleteFolder("Assets/StreamingAssets/");

            //写入Version文件和写入fullApkIdentify文件
            Version.SaveVersion2StreamingAsset(v);

            //写入配置信息
            //WriteApkConfig();

            //拷贝除apk以外的资源
            ResTool.CopyResToStreaming();


            AssetDatabase.Refresh();
            AssetDatabase.SaveAssets();

            //打包
            string apkPath  = string.Format("{0}/{1}", ResSetting.AssetBundlesOutputPath, ResSetting.GetChannelRes());
            string location = "";

            if (BuildTool.type == BuildTool.BuildType.APK)
            {
                location = string.Format("{0}/{4}/TankGirl{1}({2}).res{3}.apk", apkPath, PlayerSettings.bundleVersion, PlayerSettings.Android.bundleVersionCode, v,
                                         string.Format("{0:yyyyMMddHHmm}", System.DateTime.Now));
            }
            else
            {
                location = string.Format("{0}/TankGirl_AndroidProject/", apkPath);

                string path = location.Replace(@"\", "/");
                if (path.Contains("/"))
                {
                    string dir = path.Substring(0, path.LastIndexOf("/"));
                    DeleteADirectory(dir);
                }
            }

            BuildApk(v, location);


            AssetDatabase.Refresh();
            AssetDatabase.SaveAssets();
        }
Exemple #7
0
        public static void BuildStandaloneWithoutRebuiltRes()
        {
            Version v = Version.LoadVersionFromStreamingAsset();

            FileUtilTool.DeleteFolder("Assets/StreamingAssets/");

            //写入Version文件和写入fullApkIdentify文件
            Version.SaveVersion2StreamingAsset(v);

            //写入配置信息
            WriteStandaloneConfig();

            //拷贝除apk以外的资源
            ResTool.CopyResToStreaming();

            BuildStandaloneProject(v);


            AssetDatabase.Refresh();
            AssetDatabase.SaveAssets();
        }
Exemple #8
0
 public static void BuildAndroidRes()
 {
     BuildTool.SwitchActiveBuildTarget(BuildTarget.Android);
     ResTool.BuildLocalRes();
 }