This commit is contained in:
陈思海 2025-08-05 10:28:37 +08:00
parent d5622f5e9b
commit aac11841f2

View File

@ -16,11 +16,10 @@ public class LocalizationDropdownField : IMGUIContainer
public void InitializeElement() public void InitializeElement()
{ {
var nameArray = Enum.GetNames(typeof(Language)); var nameArray = Enum.GetNames(typeof(Language));
_languageTypeNames = new string[nameArray.Length - 1]; _languageTypeNames = new string[nameArray.Length];
for (int i = 1; i < nameArray.Length; i++) for (int i = 0; i < nameArray.Length; i++)
{ {
var name = nameArray[i]; _languageTypeNames[i] = nameArray[i];
_languageTypeNames[i - 1] = name;
} }
appConfigBtContent = appConfigBtContent =
@ -59,11 +58,12 @@ public class LocalizationDropdownField : IMGUIContainer
static void ClickToolsSubmenu(int menuIdx) static void ClickToolsSubmenu(int menuIdx)
{ {
EditorPrefs.SetInt(LocalizationComponent.PrefsKey, menuIdx + 1); EditorPrefs.SetInt(LocalizationComponent.PrefsKey, menuIdx);
Debug.Log(((Language)menuIdx).ToString());
} }
static int GetPrefsIndex() static int GetPrefsIndex()
{ {
return EditorPrefs.GetInt(LocalizationComponent.PrefsKey, 1) - 1; return EditorPrefs.GetInt(LocalizationComponent.PrefsKey, 1);
} }
} }