/// <summary> /// Print a <see cref="Settings"/> object. /// </summary> /// <param name="settings">The export package settings object.</param> /// <param name="title">The title.</param> private static void PrintSettings(ExportPackageSettings settings, string title = null) { var stringBuilder = new StringBuilder(); stringBuilder.AppendLine(UnityCommandLine.Values.SEPARATOR); if (!string.IsNullOrEmpty(title)) { stringBuilder.AppendLine(title); } ExportPackageSettings.Print(settings, stringBuilder); stringBuilder.AppendLine(UnityCommandLine.Values.SEPARATOR); PrintLine(stringBuilder.ToString()); }
/// <summary> /// Prints the values of a <see cref="ExportPackageSettings"/> instance. /// </summary> /// <param name="settings">The export package settings instance.</param> /// <param name="stringBuilder">The string builder instance.</param> public static void Print(ExportPackageSettings settings, StringBuilder stringBuilder) { const string listItemPrefix = " - "; if (settings.AssetPathNames != null && settings.AssetPathNames.Length > 0) { stringBuilder.AppendLine(string.Format("AssetPathNames:\n{0}{1}", listItemPrefix, string.Join( string.Format("\n{0}", listItemPrefix), settings.AssetPathNames))); } if (!string.IsNullOrEmpty(settings.OutputPath)) { stringBuilder.AppendLine(string.Format("OutputPath: {0}", settings.OutputPath)); } if (settings.Options != ExportPackageOptions.Default) { stringBuilder.AppendLine(string.Format("Options: {0}", settings.Options)); } }
/// <inheritdoc /> /// <summary> /// Creates an instance of <see cref="T:UnityCommandLine.AssetDatabase.ExportPackageCommandBase" />. /// </summary> protected ExportPackageCommandBase() { Settings = new ExportPackageSettings(); }
/// <summary> /// Exports a package. /// </summary> /// <param name="settings">The export package settings.</param> private static void ExportPackage(ExportPackageSettings settings) { UnityEditor.AssetDatabase.ExportPackage(settings.AssetPathNames, settings.OutputPath, settings.Options); }