diff --git a/Assets/05.TableTextConversion/Editor/ConvertedExslDataMessage.cs b/Assets/05.TableTextConversion/Editor/ConvertedExslDataMessage.cs index 03102a1..fe85995 100644 --- a/Assets/05.TableTextConversion/Editor/ConvertedExslDataMessage.cs +++ b/Assets/05.TableTextConversion/Editor/ConvertedExslDataMessage.cs @@ -34,19 +34,24 @@ namespace Stary.Evo.TableTextConversion // 转化表的名称 private static string newDataName; + [MenuItem("Evo/Utility/PlayerPrefsClear")] + private static void PlayerPrefsClear() + { + PlayerPrefs.DeleteAll(); + EditorPrefs.DeleteAll(); + } + [MenuItem("Evo/Exsl配置表/信息表转换")] static void ShowWindows() { window = (ConvertedExslDataMessage)EditorWindow.GetWindow(typeof(ConvertedExslDataMessage)); + // 添加空值检查,确保selectedDomainNames不会为null + window.selectedDomainNames = EditorPrefs.GetString("CurrentModulesName", ""); + window.configurationFileType = (ConfigurationFileType)Enum.Parse(typeof(ConfigurationFileType), + EditorPrefs.GetString("ConfigurationFileType")); window.Show(); } - protected override void Initialize() - { - base.Initialize(); - configurationFileType = (ConfigurationFileType)Enum.Parse(typeof(ConfigurationFileType), - EditorPrefs.GetString("ConfigurationFileType")); - } [Title("转化配置的Exsl文件:", titleAlignment: TitleAlignments.Centered)] [HorizontalGroup("BuildPipeline"), HideLabel] @@ -471,7 +476,7 @@ namespace Stary.Evo.TableTextConversion } else { - domains = Array.Empty(); + domains = new[] { "Default" }; } if (configurationFileType == ConfigurationFileType.Asset) @@ -491,12 +496,14 @@ namespace Stary.Evo.TableTextConversion if (configurationFileType == ConfigurationFileType.Asset) { Assetpath = Application.dataPath + "/Domain/" + newValue + "/AddressableRes/Config/"; - EditorPrefs.SetString("CurrentDomainName", newValue); + string valueToSave = string.IsNullOrEmpty(selectedDomainNames) ? "" : selectedDomainNames; + EditorPrefs.SetString("CurrentDomainName", valueToSave); } else { Assetpath = Application.dataPath + "/Modules/" + newValue + "/Main/Res/Config/"; - EditorPrefs.SetString("CurrentModulesName", newValue); + string valueToSave = string.IsNullOrEmpty(selectedDomainNames) ? "" : selectedDomainNames; + EditorPrefs.SetString("CurrentModulesName", valueToSave); } if (!Directory.Exists(Assetpath)) diff --git a/Assets/05.TableTextConversion/package.json b/Assets/05.TableTextConversion/package.json index 730cba3..7ad1dc1 100644 --- a/Assets/05.TableTextConversion/package.json +++ b/Assets/05.TableTextConversion/package.json @@ -1,6 +1,6 @@ { "name": "com.staryevo.tabletextconversion", - "version": "2.0.6", + "version": "2.0.7", "displayName": "05.TableTextConversion", "description": "表格转化工具", "unity": "2021.3",