• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    公众号

C# BuildOptions类代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

本文整理汇总了C#中BuildOptions的典型用法代码示例。如果您正苦于以下问题:C# BuildOptions类的具体用法?C# BuildOptions怎么用?C# BuildOptions使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。



BuildOptions类属于命名空间,在下文中一共展示了BuildOptions类的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的C#代码示例。

示例1: GenericBuild

 static void GenericBuild(string[] scenes, string target_dir, BuildTarget build_target, BuildOptions build_options) {
     EditorUserBuildSettings.SwitchActiveBuildTarget(build_target);
     string res = BuildPipeline.BuildPlayer(scenes, target_dir, build_target, build_options);
     if (res.Length > 0) {
         throw new Exception("BuildPlayer failure: " + res);
     }
 }
开发者ID:HardnHeavy,项目名称:Routines,代码行数:7,代码来源:CIBuilder.cs


示例2: BuildGame

    public static void BuildGame(BuildTarget buildTarget, BuildOptions buildOptions = BuildOptions.None)
    {
        if (BuildPipeline.isBuildingPlayer == false) {
            UnityEngine.Debug.ClearDeveloperConsole();

            var smcsFile = Path.Combine( Application.dataPath, "smcs.rsp" );
            var gmcsFile = Path.Combine( Application.dataPath, "gmcs.rsp" );

            // -define:debug;poop
            File.WriteAllText( smcsFile, "-define:BUILD" );
            File.WriteAllText( gmcsFile, "-define:BUILD" );

            AssetDatabase.Refresh();

            string[] scenes = GetSceneList();
            //string path = Application.dataPath.Remove(Application.dataPath.Length - 8, 7) + "_build";

            // Build player.
            BuildPipeline.BuildPlayer(scenes, path + "/" + StringManager.BUILDNAME + ".exe", buildTarget, buildOptions);

            // Copy a file from the project folder to the build folder, alongside the built game. eg:
            // FileUtil.CopyFileOrDirectory("Assets/WebPlayerTemplates/Readme.txt", path + "Readme.txt");

            //remove build thingies
            File.WriteAllText( smcsFile, "" );
            File.WriteAllText( gmcsFile, "" );
        }
    }
开发者ID:chicostategamestudios,项目名称:qk-pop,代码行数:28,代码来源:ScriptBuild.cs


示例3: BuildConfiguration

 private BuildConfiguration()
 {
     this.scenes = new List<string>();
     this.dirMappings = new Dictionary<string, string>();
     this.fileMappings = new Dictionary<string, string>();
     this.options = BuildOptions.None;
 }
开发者ID:Elideb,项目名称:UnExt,代码行数:7,代码来源:BuildConfiguration.cs


示例4: BaseBuilder

 public BaseBuilder()
 {
     Name = "Base";
     options = BuildOptions.None;
     target = BuildTarget.Android;
     DefineSymbols = "";
 }
开发者ID:dudor,项目名称:unity3dbuildmanager,代码行数:7,代码来源:BuildManager.cs


示例5: BuildPlayer

        string BuildPlayer(BuildTarget target, BuildOptions options, params string[] levels)
        {
            var output = Path.Combine(OutputDir, target.ToString());
            DirectoryEx.DeleteDirectory(output);

            BuildPipeline.BuildPlayer(levels, output, target,  options);
            return output;
        }
开发者ID:learnUnity,项目名称:AssetBundlePatch,代码行数:8,代码来源:OneBuilderEditor.cs


示例6: PerformIOSReleaseBuild

    public static void PerformIOSReleaseBuild()
    {
        _excelSuccessCallback = DoIOSReleaseBuild;

        _buildOptions = BuildOptions.Il2CPP;

        // Process the Excel Files
        ProcessExcelFiles();
    }
开发者ID:Benzino,项目名称:ExcelToJsonConverter,代码行数:9,代码来源:BuildScript.cs


示例7: GetExtensionForBuildTarget

 public static string GetExtensionForBuildTarget(BuildTarget target, BuildOptions options)
 {
     IBuildPostprocessor buildPostProcessor = ModuleManager.GetBuildPostProcessor(target);
     if (buildPostProcessor == null)
     {
         return string.Empty;
     }
     return buildPostProcessor.GetExtension(target, options);
 }
开发者ID:CarlosHBC,项目名称:UnityDecompiled,代码行数:9,代码来源:PostprocessBuildPlayer.cs


示例8: ParseArgs

        private static void ParseArgs(ref BuildOptions opt, ref string outputpath)
        {
            string[] args = System.Environment.GetCommandLineArgs();

            string productPath = Path.Combine(Application.dataPath, KEngine.AppEngine.GetConfig("ProductRelPath"));

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

            if (args.Length >= 2)
            {
                CommandArgs commandArg = CommandLine.Parse(args);
                //List<string> lparams = commandArg.Params;
                Dictionary<string, string> argPairs = commandArg.ArgPairs;

                foreach (KeyValuePair<string, string> item in argPairs)
                {
                    switch (item.Key)
                    {
                        case "BundleVersion":
                            PlayerSettings.bundleVersion = item.Value;
                            break;
                        case "AndroidVersionCode":
                            PlayerSettings.Android.bundleVersionCode = System.Int32.Parse(item.Value);
                            break;
                        case "AndroidKeyStoreName":
                            PlayerSettings.Android.keystoreName = item.Value;
                            break;
                        case "AndroidKeyStorePass":
                            PlayerSettings.Android.keystorePass = item.Value;
                            break;
                        case "AndroidkeyAliasName":
                            PlayerSettings.Android.keyaliasName = item.Value;
                            break;
                        case "AndroidKeyAliasPass":
                            PlayerSettings.Android.keyaliasPass = item.Value;
                            break;
                        case "BuildOptions":
                        {
                            opt = BuildOptions.None;
                            string[] opts = item.Value.Split('|');
                            foreach (string o in opts)
                            {
                                opt = opt | (BuildOptions) System.Enum.Parse(typeof (BuildOptions), o);
                            }
                        }
                            break;
                        case "Outputpath":
                            outputpath = item.Value;
                            break;
                    }
                    UnityEngine.Debug.Log(item.Key + " : " + item.Value);
                }
            }
        }
开发者ID:s3chugo,项目名称:KEngine,代码行数:57,代码来源:KAutoBuilder.cs


示例9: PerformIOSReleaseBuildAndRun

    public static void PerformIOSReleaseBuildAndRun()
    {
        _excelSuccessCallback = DoIOSReleaseBuild;

        _buildOptions = BuildOptions.Il2CPP | BuildOptions.AutoRunPlayer;

        // Process the Excel Files
        ProcessExcelFiles();
    }
开发者ID:Benzino,项目名称:ExcelToJsonConverter,代码行数:9,代码来源:BuildScript.cs


示例10: GetScriptLayoutFileFromBuild

 public static string GetScriptLayoutFileFromBuild(BuildOptions options, BuildTarget target, string installPath, string fileName)
 {
     IBuildPostprocessor buildPostProcessor = ModuleManager.GetBuildPostProcessor(target);
     if (buildPostProcessor != null)
     {
         return buildPostProcessor.GetScriptLayoutFileFromBuild(options, installPath, fileName);
     }
     return "";
 }
开发者ID:CarlosHBC,项目名称:UnityDecompiled,代码行数:9,代码来源:PostprocessBuildPlayer.cs


示例11: PerformIOSDebugBuild

    public static void PerformIOSDebugBuild()
    {
        _excelSuccessCallback = DoIOSDebugBuild;

        _buildOptions = BuildOptions.Il2CPP | BuildOptions.Development | BuildOptions.AllowDebugging | BuildOptions.SymlinkLibraries;

        // Process the Excel Files
        ProcessExcelFiles();
    }
开发者ID:Benzino,项目名称:ExcelToJsonConverter,代码行数:9,代码来源:BuildScript.cs


示例12: GenericBuild

    static void GenericBuild(string[] scenes, string target_filename, BuildTarget build_target, BuildOptions build_options)
    {
        EditorUserBuildSettings.SwitchActiveBuildTarget(build_target);
        Debug.Log("-- 빌드 과정을 시작합니다...");
        string res = BuildPipeline.BuildPlayer(scenes, target_filename, build_target, build_options);
        if (res.Length > 0) {

            throw new Exception("빌드 실패: " + res);
        }
    }
开发者ID:hlees,项目名称:testandroid,代码行数:10,代码来源:BuildScript.cs


示例13: DrawGUI

    public void DrawGUI(uBuildWindow window)
    {
        EditorGUILayout.BeginHorizontal();
        IsFoldOut = EditorGUILayout.Foldout( IsFoldOut, BuildName + " (" + target.ToString() + ')');
        GUILayout.FlexibleSpace();
        if(Errors.Count > 0)
        {
            GUILayout.Label(window.errBtnContent);
        }
        if(GUILayout.Button(window.rmBtnContent))
        {
            window.RemoveBuildSetting(this);
        }
        EditorGUILayout.EndHorizontal();

        if(IsFoldOut)
        {
            isEnabled = EditorGUILayout.Toggle("Enabled?", isEnabled);
            GUI.enabled = isEnabled;
            BuildName = EditorGUILayout.TextField("BuildName: ", BuildName);

            BuildTarget newtarget = (BuildTarget)EditorGUILayout.EnumPopup("Target: ", target);
            if(newtarget != target)
            {
                Extension = Extension == DeterminateExtension(target) ? DeterminateExtension(newtarget) : Extension;
                target = newtarget;
            }
            options = (BuildOptions)EditorGUILayout.EnumMaskField("Options: ", options);

            HasCustomExtension = EditorGUILayout.ToggleLeft("Custom Extension?", HasCustomExtension);

            if(HasCustomExtension)
            {
                EditorGUILayout.BeginHorizontal();
                Extension = EditorGUILayout.TextField("Custom Extension: ", Extension ?? DeterminateExtension(target));
                EditorGUILayout.EndHorizontal();
            }
            GUI.enabled = true;

            if(Errors.Count > 0)
            {
                //EditorGUILayout.BeginScrollView(errorScroll, false, false);
                GUILayout.Space(10);
                EditorGUILayout.BeginHorizontal();
                for (int i = 0; i < Errors.Count;++i)
                {

                    Vector2 h = GUI.skin.button.CalcSize(new GUIContent(Errors[i]));
                    EditorGUILayout.SelectableLabel(Errors[i], GUILayout.Height(h.y), GUILayout.Width(h.x));
                }
                EditorGUILayout.EndHorizontal();
                //EditorGUILayout.EndScrollView();
            }
        }
    }
开发者ID:HatiEth,项目名称:uBuild,代码行数:55,代码来源:uBuildSetting.cs


示例14: GenericBuild

 static void GenericBuild(string[] scenes, string target_dir, BuildTarget build_target, BuildOptions build_options)
 {
     if(!Directory.Exists(TARGET_DIR)){
         Directory.CreateDirectory(TARGET_DIR);
     }
         EditorUserBuildSettings.SwitchActiveBuildTarget(build_target);
         string res = BuildPipeline.BuildPlayer(scenes,target_dir,build_target,build_options);
         if (res.Length > 0) {
                 throw new Exception("BuildPlayer failure: " + res);
         }
 }
开发者ID:charliehuge,项目名称:GGJ13,代码行数:11,代码来源:CIEditor.cs


示例15: BuildLogger

        internal BuildLogger(IApp app, Document doc, ScintillaControl sci, BuildOptions options)
        {
            this.app = app;
            this.doc = doc;
            this.sci = sci;
            this.options = options;

            app.CloseView("ErrorList");
            this.err = app.GetService<IErrorListService>();
            this.output = app.GetService<IOutputService>();
        }
开发者ID:rizwan3d,项目名称:elalang,代码行数:11,代码来源:BuildLogger.cs


示例16: PrepareForBuild

 public override string PrepareForBuild(BuildOptions options, BuildTarget target)
 {
     if (EditorUserBuildSettings.wsaSDK != WSASDK.UWP)
     {
         return null;
     }
     if (Utility.UseIl2CppScriptingBackend())
     {
         return null;
     }
     return NuGet.Restore(target);
 }
开发者ID:CarlosHBC,项目名称:UnityDecompiled,代码行数:12,代码来源:BuildPostprocessor.cs


示例17: BuildPlatform

    static void BuildPlatform(BuildTarget target, string locationPathNameBase, BuildOptions options = BuildOptions.None, string gameNamePostfix = "")
    {
        Directory.CreateDirectory(locationPathNameBase);

        var s = Path.Combine(locationPathNameBase, GetName(target, gameNamePostfix));

        Debug.Log(string.Format("building {0} to {1}", target, s));

        OnPreBuild(target, locationPathNameBase, s);
        BuildPipeline.BuildPlayer(GetLevels(target), s, target, options);
        OnPostBuild(target, locationPathNameBase, s);
    }
开发者ID:hagish,项目名称:kalimba-desktop,代码行数:12,代码来源:Build.cs


示例18: FromJson

    public void FromJson(JObject json)
    {
        this.buildPath = null;
        this.scenesInBuild.Clear();
        this.buildTarget = (BuildTarget)0;
        this.buildOptions = BuildOptions.None;

        if (json == null)
        {
            return;
        }

        JToken obj;
        if (json.TryGetValue("path", out obj))
        {
            this.buildPath = (string)obj;
        }

        if (json.TryGetValue("buildTarget", out obj))
        {
            this.buildTarget = (BuildTarget)System.Enum.Parse(typeof(BuildTarget), (string)obj, true);
        }

        if (json.TryGetValue("buildOptions", out obj))
        {
            var options = (JObject)obj;
            var co = (CustomBuildOptions)this.buildOptions;
            foreach (var p in options)
            {
                if ((bool)p.Value)
                {
                    try
                    {
                        co |= (CustomBuildOptions)System.Enum.Parse(typeof(CustomBuildOptions), p.Key, true);
                    }
                    catch
                    {
                    }
                }
            }
            this.buildOptions = (BuildOptions)co;
        }

        if (json.TryGetValue("scenes", out obj))
        {
            var scenes = (JArray)obj;
            foreach (var s in scenes)
            {
                this.scenesInBuild.Add((string)s);
            }
        }
    }
开发者ID:ucpp,项目名称:CustomBuilder,代码行数:52,代码来源:CustomBuilderConfiguration.cs


示例19: BuildPlayer

 /// <summary>
 ///   <para>Builds a player.</para>
 /// </summary>
 /// <param name="levels">The scenes to be included in the build. If empty, the currently open scene will be built. Paths are relative to the project folder (AssetsMyLevelsMyScene.unity).</param>
 /// <param name="locationPathName">The path where the application will be built.</param>
 /// <param name="target">The BuildTarget to build.</param>
 /// <param name="options">Additional BuildOptions, like whether to run the built player.</param>
 /// <returns>
 ///   <para>An error message if an error occurred.</para>
 /// </returns>
 public static string BuildPlayer(string[] levels, string locationPathName, BuildTarget target, BuildOptions options)
 {
   try
   {
     uint crc;
     return BuildPipeline.BuildPlayerInternal(levels, locationPathName, target, options, out crc);
   }
   catch (Exception ex)
   {
     BuildPipeline.LogBuildExceptionAndExit("BuildPipeline.BuildPlayer", ex);
     return string.Empty;
   }
 }
开发者ID:BlakeTriana,项目名称:unity-decompiled,代码行数:23,代码来源:BuildPipeline.cs


示例20: BuildProject

    public static void BuildProject(BuildOptions _buildOption)
    {
        string[] activeScenes = GetActiveScenes();

        // get productName
        string productName = PlayerSettings.productName;
        string dateTimeNow = DateTime.Now.ToString("MM-dd-yy_HHmm");
        string buildName = productName + "_" + dateTimeNow;

        if ((productName.IndexOf("_") != -1))
        {
            productName = productName.Substring(productName.IndexOf("_") + 1);
        }

        // save location
        CreatFolder(Application.dataPath + "/../Builds/" + buildName);

        // get path from save panel
        path = EditorUtility.SaveFilePanel("Build", "Builds/" + buildName, buildName, "exe");

        if (string.Compare(path, "") != 0)
        {
            // hold file extensions
            string tail = "";
            // add .exe if needed
            tail = path.Substring(Math.Max(0, path.Length - 4));
            if (string.Compare(tail, ".exe") != 0)
            {
                path += ".exe";
            }

            UpdateVersionNumber();

            if (copyConfig){
                CopyAssets(configAssetPath, configBuildPath);
            }
            
            if(copyBatch){
                CopyBatch(batchAssetPath, batchBuildPath + buildName, buildName);
            }

            // build
            BuildPipeline.BuildPlayer(activeScenes, path, EditorUserBuildSettings.activeBuildTarget,
                                      BuildOptions.ShowBuiltPlayer | _buildOption);
        }
        else
        {
            Debug.Log("Failed to Build: Missing build name or file path");
        }
    }
开发者ID:HuffyTomson,项目名称:LittleBigBoy,代码行数:50,代码来源:AutoBuild.cs



注:本文中的BuildOptions类示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
C# BuildStatus类代码示例发布时间:2022-05-24
下一篇:
C# BuildInfo类代码示例发布时间:2022-05-24
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap