Пример #1
0
        private void _DrawBuild(IPhoneConfig config, BuildOptions options)
        {
            if (GUILayout.Button("Build iPhone", _buttonWidth))
            {
                if (string.IsNullOrEmpty(config.projectPath))
                {
                    EditorUtility.DisplayDialog("Warning", "Please choose a Project Location", "Ok");
                    return;
                }

                var projectPath = os.path.join(config.projectPath, "Unity-iPhone.xcodeproj");
                if (Directory.Exists(projectPath))
                {
                    var title   = "Warning";
                    var message = "Build folder already exists. Would you like to append or replace it?";
                    var option  = EditorUtility.DisplayDialogComplex(title, message, "Cancel", "Append", "Replace");

                    if (option == 0)
                    {
                        return;
                    }
                    else if (option == 1)
                    {
                        options |= BuildOptions.AcceptExternalModificationsToPlayer;
                    }
                }

                var error = BuildPipeline.BuildPlayer(_GetLevels(), config.projectPath, BuildTarget.iOS, options);
                if (!string.IsNullOrEmpty(error))
                {
                    Console.Error.WriteLine("BuildPipeline.BuildPlayer() error={0}", error);
                    return;
                }

                if (config.builtinResources)
                {
                    var rawFolder = os.path.join(config.projectPath, "Data/Raw");
                    var flags     = PackFlags.SearchAllDirectories;
                    PackTools.PackResourcesTo(rawFolder, flags);
                }

                os.startfile(projectPath, null, true);
            }
        }
Пример #2
0
        private BuildOptions _DrawBuildOptions(IPhoneConfig config)
        {
            BuildOptions options = BuildOptions.None;

            _LeaveSpace();
            _DrawIl2CPP();
            _DrawSymlinkLibraries(ref options);
            _DrawDevelopmentBuild(ref options);
            _DrawConnectProfiler(ref options);
            _DrawAllowDebugging(ref options);

            _LeaveSpace();

            config.ShowBuiltPlayer = GUILayout.Toggle(config.ShowBuiltPlayer, "Show Built Player Folder");
            if (config.ShowBuiltPlayer)
            {
                options |= BuildOptions.ShowBuiltPlayer;
            }

            return(options);
        }