File tree Expand file tree Collapse file tree 2 files changed +11
-1
lines changed
Expand file tree Collapse file tree 2 files changed +11
-1
lines changed Original file line number Diff line number Diff line change @@ -160,10 +160,12 @@ private void Start()
160160 JCS_GameManager . FirstInstance ( ) . RegisterOnSystemAfterInit ( RefreshSimulateLanguage ) ;
161161 }
162162
163+ #if UNITY_EDITOR
163164 private void OnValidate ( )
164165 {
165166 RefreshSimulateLanguage ( ) ;
166167 }
168+ #endif
167169
168170 public bool IsPC ( ) { return ( mPlatformType == JCS_PlatformType . PC ) ; }
169171 public bool IsMobile ( ) { return ( mPlatformType == JCS_PlatformType . MOBILE ) ; }
Original file line number Diff line number Diff line change @@ -78,6 +78,9 @@ public void Refresh(bool removeAllOptions)
7878 if ( removeAllOptions )
7979 ClearOptions ( ) ;
8080
81+ if ( mOptions . Count == 0 )
82+ return ;
83+
8184 foreach ( SystemLanguage option in mOptions )
8285 {
8386 string text = JCS_Locale . SystemLangToString ( option ) ;
@@ -87,7 +90,9 @@ public void Refresh(bool removeAllOptions)
8790
8891 // Default to the current windowed mode.
8992 {
90- string text = JCS_Locale . SystemLangToString ( JCS_AppManager . FirstInstance ( ) . systemLanguage ) ;
93+ SystemLanguage lang = JCS_AppManager . FirstInstance ( ) . systemLanguage ;
94+
95+ string text = JCS_Locale . SystemLangToString ( lang ) ;
9196
9297 JCS_UIUtil . Dropdown_SetSelection ( this , text ) ;
9398 }
@@ -115,6 +120,9 @@ private void OnValueChanged_TMP(TMP_Dropdown dropdown)
115120 }
116121 private void OnValueChanged ( string text )
117122 {
123+ if ( mOptions . Count == 0 )
124+ return ;
125+
118126 SystemLanguage selected = JCS_Locale . StringToSystemLang ( text ) ;
119127
120128 JCS_AppManager . FirstInstance ( ) . systemLanguage = selected ;
You can’t perform that action at this time.
0 commit comments