Skip to content

Commit dafc2bb

Browse files
committed
feat: Onvalidate the simluate system language
1 parent 6519e5e commit dafc2bb

File tree

1 file changed

+18
-1
lines changed

1 file changed

+18
-1
lines changed

Assets/JCSUnity/Scripts/Managers/JCS_AppManager.cs

Lines changed: 18 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -89,7 +89,6 @@ public JCS_PlatformType PlatformType
8989
this.mPlatformType = value;
9090
}
9191
}
92-
public bool SimulateSystemLanguage { get { return this.mSimulateSystemLanguage; } set { this.mSimulateSystemLanguage = value; } }
9392
public SystemLanguage systemLanguage
9493
{
9594
get { return this.mSystemLanguage; }
@@ -102,6 +101,18 @@ public SystemLanguage systemLanguage
102101
onSystemLanguageChanged.Invoke(value);
103102
}
104103
}
104+
public bool SimulateSystemLanguage { get { return this.mSimulateSystemLanguage; } set { this.mSimulateSystemLanguage = value; } }
105+
public SystemLanguage SimulateLanguage
106+
{
107+
get { return this.mSimulateLanguage; }
108+
set
109+
{
110+
this.mSimulateLanguage = value;
111+
112+
if (mSimulateSystemLanguage)
113+
systemLanguage = value;
114+
}
115+
}
105116
public bool RequestCamera { get { return this.mRequestCamera; } }
106117
public bool RequestMicrophone { get { return this.mRequestMicrophone; } }
107118
public bool RequestLocation { get { return this.mRequestLocation; } }
@@ -145,6 +156,12 @@ private void Awake()
145156
APP_INITIALIZING = false;
146157
}
147158

159+
private void OnValidate()
160+
{
161+
if (mSimulateSystemLanguage)
162+
systemLanguage = SimulateLanguage;
163+
}
164+
148165
public bool IsPC() { return (PlatformType == JCS_PlatformType.PC); }
149166
public bool IsMobile() { return (PlatformType == JCS_PlatformType.MOBILE); }
150167

0 commit comments

Comments
 (0)