update libs

This commit is contained in:
Kirill Chikalin
2025-02-13 17:48:12 +03:00
parent e17e7c2786
commit 275dc598c7
816 changed files with 22479 additions and 10792 deletions

View File

@@ -6,14 +6,13 @@ using UnityEngine;
namespace AssetStoreTools.Utility
{
internal class ASToolsPreferences
{
private static ASToolsPreferences s_instance;
public static ASToolsPreferences Instance => s_instance ?? (s_instance = new ASToolsPreferences());
public static event Action OnSettingsChange;
private ASToolsPreferences()
{
Load();
@@ -27,7 +26,6 @@ namespace AssetStoreTools.Utility
DisplayHiddenMetaDialog = PlayerPrefs.GetInt("AST_HiddenFolderMetaCheck", 1) == 1;
EnableSymlinkSupport = PlayerPrefs.GetInt("AST_EnableSymlinkSupport", 0) == 1;
UseLegacyExporting = PlayerPrefs.GetInt("AST_UseLegacyExporting", 0) == 1;
DisplayUploadDialog = PlayerPrefs.GetInt("AST_DisplayUploadDialog", 0) == 1;
}
public void Save(bool triggerSettingsChange = false)
@@ -38,10 +36,9 @@ namespace AssetStoreTools.Utility
PlayerPrefs.SetInt("AST_HiddenFolderMetaCheck", DisplayHiddenMetaDialog ? 1 : 0);
PlayerPrefs.SetInt("AST_EnableSymlinkSupport", EnableSymlinkSupport ? 1 : 0);
PlayerPrefs.SetInt("AST_UseLegacyExporting", UseLegacyExporting ? 1 : 0);
PlayerPrefs.SetInt("AST_DisplayUploadDialog", DisplayUploadDialog ? 1 : 0);
PlayerPrefs.Save();
if(triggerSettingsChange)
if (triggerSettingsChange)
OnSettingsChange?.Invoke();
}
@@ -55,16 +52,16 @@ namespace AssetStoreTools.Utility
/// </summary>
public bool LegacyVersionCheck;
/// <summary>
/// Check if the package has been uploader from a correct Unity version at least once
/// </summary>
public bool UploadVersionCheck;
/// <summary>
/// Enables a DisplayDialog when hidden folders are found to be missing meta files
/// </summary>
public bool DisplayHiddenMetaDialog;
/// <summary>
/// Check if the package has been uploaded from a correct Unity version at least once
/// </summary>
public bool UploadVersionCheck;
/// <summary>
/// Enables Junction symlink support
/// </summary>
@@ -74,17 +71,12 @@ namespace AssetStoreTools.Utility
/// Enables legacy exporting for Folder Upload workflow
/// </summary>
public bool UseLegacyExporting;
/// <summary>
/// Enables DisplayDialog to be shown after the uploading ends
/// </summary>
public bool DisplayUploadDialog;
}
internal class ASToolsPreferencesProvider : SettingsProvider
{
private const string SettingsPath = "Project/Asset Store Tools";
private class Styles
{
public static readonly GUIContent CheckForUpdatesLabel = EditorGUIUtility.TrTextContent("Check for Updates", "Periodically check if an update for the Asset Store Publishing Tools is available.");
@@ -93,7 +85,7 @@ namespace AssetStoreTools.Utility
public static readonly GUIContent DisplayHiddenMetaDialogLabel = EditorGUIUtility.TrTextContent("Display Hidden Folder Meta Dialog", "Show a DisplayDialog when hidden folders are found to be missing meta files.\nNote: this only affects hidden folders ending with a '~' character");
public static readonly GUIContent EnableSymlinkSupportLabel = EditorGUIUtility.TrTextContent("Enable Symlink Support", "Enable Junction Symlink support. Note: folder selection validation will take longer.");
public static readonly GUIContent UseLegacyExportingLabel = EditorGUIUtility.TrTextContent("Use Legacy Exporting", "Enabling this option uses native Unity methods when exporting packages for the Folder Upload workflow.\nNote: individual package dependency selection when choosing to 'Include Package Manifest' is unavailable when this option is enabled.");
public static readonly GUIContent DisplayUploadDialogLabel = EditorGUIUtility.TrTextContent("Display Upload Dialog", "Show a DisplayDialog after the package uploading has finished.");
public static readonly GUIContent UseCustomPreviewsLabel = EditorGUIUtility.TrTextContent("Enable High Quality Previews (experimental)", "Override native asset preview retrieval with higher-quality preview generation");
}
public static void OpenSettings()
@@ -103,10 +95,11 @@ namespace AssetStoreTools.Utility
private ASToolsPreferencesProvider(string path, SettingsScope scopes, IEnumerable<string> keywords = null)
: base(path, scopes, keywords) { }
public override void OnGUI(string searchContext)
{
var preferences = ASToolsPreferences.Instance;
EditorGUI.BeginChangeCheck();
using (CreateSettingsWindowGUIScope())
{
@@ -116,20 +109,21 @@ namespace AssetStoreTools.Utility
preferences.DisplayHiddenMetaDialog = EditorGUILayout.Toggle(Styles.DisplayHiddenMetaDialogLabel, preferences.DisplayHiddenMetaDialog);
preferences.EnableSymlinkSupport = EditorGUILayout.Toggle(Styles.EnableSymlinkSupportLabel, preferences.EnableSymlinkSupport);
preferences.UseLegacyExporting = EditorGUILayout.Toggle(Styles.UseLegacyExportingLabel, preferences.UseLegacyExporting);
preferences.DisplayUploadDialog = EditorGUILayout.Toggle(Styles.DisplayUploadDialogLabel, preferences.DisplayUploadDialog);
}
if (EditorGUI.EndChangeCheck())
{
ASToolsPreferences.Instance.Save(true);
}
}
[SettingsProvider]
public static SettingsProvider CreateAssetStoreToolsSettingProvider()
{
var provider = new ASToolsPreferencesProvider(SettingsPath, SettingsScope.Project, GetSearchKeywordsFromGUIContentProperties<Styles>());
return provider;
}
private IDisposable CreateSettingsWindowGUIScope()
{
var unityEditorAssembly = Assembly.GetAssembly(typeof(EditorWindow));