Beispiel #1
0
        /// <summary>
        /// build apk,Assetbunld 位于Streaming下~
        /// </summary>
        static public void BuildALLAssetsAndBuildInPackage_APK()
        {
            _initArgs();

            _androidCheck();

            _setPass();

            var outputPath = _getOutPath();

            //清空StreamingAsset
            var ios = IPath.Combine(Application.streamingAssetsPath, "iOS");

            if (Directory.Exists(ios))
            {
                Directory.Delete(ios, true);
            }

            var win = IPath.Combine(Application.streamingAssetsPath, "Windows");

            if (Directory.Exists(win))
            {
                Directory.Delete(win, true);
            }

            //开始项目一键打包
            EditorWindow_OnkeyBuildAsset.OneKeyBuildALLAssets_ForBuildPackage(RuntimePlatform.Android,
                                                                              Application.streamingAssetsPath);
            BuildPipeline.BuildPlayer(EditorBuildSettings.scenes, outputPath, BuildTarget.Android, BuildOptions.None);
        }
Beispiel #2
0
        /// <summary>
        /// 只生成资源,
        /// 需要cmd传参
        /// </summary>
        static public void BuildALLAssets_iOS()
        {
            _initArgs();
            var outputPath = _getOutPath();

            EditorWindow_OnkeyBuildAsset.OneKeyBuildALLAssets_ForBuildPackage(RuntimePlatform.IPhonePlayer, outputPath);
        }
Beispiel #3
0
        /// <summary>
        /// build apk,Assetbunld 位于Streaming下~
        /// </summary>
        static public void BuildALLAssetsAndBuildInPackage_iOS_Editor()
        {
            var outputPath = Application.streamingAssetsPath + "/" + DateTime.Now.ToShortTimeString() + ".apk";
            //清空StreamingAsset
            var and = IPath.Combine(Application.streamingAssetsPath, "Android");

            if (Directory.Exists(and))
            {
                Directory.Delete(and, true);
            }

            var win = IPath.Combine(Application.streamingAssetsPath, "Windows");

            if (Directory.Exists(win))
            {
                Directory.Delete(win, true);
            }

            //开始项目一键打包
            EditorWindow_OnkeyBuildAsset.OneKeyBuildALLAssets_ForBuildPackage(RuntimePlatform.IPhonePlayer,
                                                                              Application.streamingAssetsPath);
            UnityEditor.BuildPipeline.BuildPlayer(EditorBuildSettings.scenes, outputPath, BuildTarget.iOS,
                                                  BuildOptions.None);

            //TODO  Build 完之后,需要调用shell 编译xcode
        }
Beispiel #4
0
        /// <summary>
        /// build apk,Assetbunld 位于Streaming下~
        /// </summary>
        static public void BuildALLAssetsAndBuildInPackage_APK_Editor()
        {
            BDebug.Log("请注意apk keystore 账号密码");
//            PlayerSettings.Android.keystoreName = "";
//            PlayerSettings.keyaliasPass = "******";
//            PlayerSettings.keystorePass = "******";
            var outputPath = Application.streamingAssetsPath + "/" + DateTime.Now.ToShortTimeString() + ".apk";
            //清空StreamingAsset
            var ios = IPath.Combine(Application.streamingAssetsPath, "iOS");

            if (Directory.Exists(ios))
            {
                Directory.Delete(ios, true);
            }

            var win = IPath.Combine(Application.streamingAssetsPath, "Windows");

            if (Directory.Exists(win))
            {
                Directory.Delete(win, true);
            }

            //开始项目一键打包
            EditorWindow_OnkeyBuildAsset.OneKeyBuildALLAssets_ForBuildPackage(RuntimePlatform.Android, Application.streamingAssetsPath);
            BuildPipeline.BuildPlayer(EditorBuildSettings.scenes, outputPath, BuildTarget.Android, BuildOptions.None);
        }
Beispiel #5
0
        /// <summary>
        /// 只生成资源,
        /// 需要cmd传参
        /// </summary>
        static public void BuildALLAssets_APK()
        {
            _initArgs();
            _setPass();
            var outputPath = _getOutPath();

            EditorWindow_OnkeyBuildAsset.OneKeyBuildALLAssets_ForBuildPackage(RuntimePlatform.Android, outputPath);
        }