UnityEditor.BuildPipeline.LogBuildExceptionAndExit C# (CSharp) Method

LogBuildExceptionAndExit() private static method

private static LogBuildExceptionAndExit ( string buildFunctionName, Exception exception ) : void
buildFunctionName string
exception System.Exception
return void
        private static void LogBuildExceptionAndExit(string buildFunctionName, Exception exception)
        {
            object[] args = new object[] { buildFunctionName };
            Debug.LogErrorFormat("Internal Error in {0}:", args);
            Debug.LogException(exception);
            EditorApplication.Exit(1);
        }

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::LogBuildExceptionAndExit