From 21bcc4f1388618850845e4348ee068803b7c1f99 Mon Sep 17 00:00:00 2001 From: suzuryg Date: Wed, 22 May 2024 23:53:33 +0900 Subject: [PATCH] fix: en_us locale causes leakage of ScriptableObject --- .../Editor/Detail/Localization/LocalizationSetting.cs | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/Packages/jp.suzuryg.face-emo/Editor/Detail/Localization/LocalizationSetting.cs b/Packages/jp.suzuryg.face-emo/Editor/Detail/Localization/LocalizationSetting.cs index 509f9b05..b1030140 100644 --- a/Packages/jp.suzuryg.face-emo/Editor/Detail/Localization/LocalizationSetting.cs +++ b/Packages/jp.suzuryg.face-emo/Editor/Detail/Localization/LocalizationSetting.cs @@ -35,6 +35,8 @@ public class LocalizationSetting : IReadOnlyLocalizationSetting, ILocalizationSe private Subject _onTableChanged = new Subject(); + private static LocalizationTable en_us; + public LocalizationSetting() { var locale = GetLocale(); @@ -87,7 +89,9 @@ public static LocalizationTable GetTable(Locale locale) else { // en_US has the table in source code, not asset. - return ScriptableObject.CreateInstance(); + en_us = en_us != null ? en_us : ScriptableObject.CreateInstance(); + + return en_us; } }