UnityEditor.BuildPipeline.BuildPlayerInternal C# (CSharp) Method

BuildPlayerInternal() private static method

private static BuildPlayerInternal ( string levels, string locationPathName, string assetBundleManifestPath, BuildTarget target, BuildOptions options ) : BuildReport
levels string
locationPathName string
assetBundleManifestPath string
target BuildTarget
options BuildOptions
return BuildReport
        private static BuildReport BuildPlayerInternal(string[] levels, string locationPathName, string assetBundleManifestPath, BuildTarget target, BuildOptions options)
        {
            if (((BuildOptions.EnableHeadlessMode & options) != BuildOptions.CompressTextures) && ((BuildOptions.Development & options) != BuildOptions.CompressTextures))
            {
                throw new Exception("Unsupported build setting: cannot build headless development player");
            }
            return BuildPlayerInternalNoCheck(levels, locationPathName, assetBundleManifestPath, target, options, false);
        }

Usage Example

        private static string BuildPlayer(string[] scenes, string locationPathName, string assetBundleManifestPath, BuildTarget target, BuildOptions options)
        {
            string result;

            if (string.IsNullOrEmpty(locationPathName))
            {
                if ((options & BuildOptions.InstallInBuildFolder) == BuildOptions.None || !PostprocessBuildPlayer.SupportsInstallInBuildFolder(target))
                {
                    result = "The 'locationPathName' parameter for BuildPipeline.BuildPlayer should not be null or empty.";
                    return(result);
                }
            }
            else if (string.IsNullOrEmpty(Path.GetFileName(locationPathName)))
            {
                string extensionForBuildTarget = PostprocessBuildPlayer.GetExtensionForBuildTarget(target, options);
                if (!string.IsNullOrEmpty(extensionForBuildTarget))
                {
                    result = string.Format("For the '{0}' target the 'locationPathName' parameter for BuildPipeline.BuildPlayer should not end with a directory separator.\nProvided path: '{1}', expected a path with the extension '.{2}'.", target, locationPathName, extensionForBuildTarget);
                    return(result);
                }
            }
            try
            {
                result = BuildPipeline.BuildPlayerInternal(scenes, locationPathName, assetBundleManifestPath, target, options).SummarizeErrors();
            }
            catch (Exception exception)
            {
                BuildPipeline.LogBuildExceptionAndExit("BuildPipeline.BuildPlayer", exception);
                result = "";
            }
            return(result);
        }
All Usage Examples Of UnityEditor.BuildPipeline::BuildPlayerInternal