private void ReceiveLocalizationReloaded(LocalizationReloaded localizationReloaded) { bool flag = (this.isChina && localizationReloaded.currentLanguage != "zh-CN") || (!this.isChina && localizationReloaded.currentLanguage == "zh-CN"); if (flag) { int childCount = base.transform.childCount; int num = childCount; while (--num >= 0) { Transform child = base.transform.GetChild(num); if (child.name.Contains("Button")) { UnityEngine.Object.DestroyImmediate(child.gameObject); } } if (Singleton <Localizer> .Instance.CurrentLocale == "zh-CN" || Singleton <BuildCustomizationLoader> .Instance.IsChina) { this.LoadButtonToSocialMedia("WeibosButton", "LaunchWeibos"); this.LoadButtonToSocialMedia("FilmButton", "LaunchYoutubeFilmChina"); this.isChina = true; } else { this.LoadButtonToSocialMedia("FacebookButton", "LaunchFacebook"); this.LoadButtonToSocialMedia("TwitterButton", "LaunchTwitter"); this.LoadButtonToSocialMedia("FilmButton", "LaunchYoutubeFilm"); this.isChina = false; } base.SetInitialValues(); GameObject.Find("MainMenuLogic").GetComponent <MainMenu>().SocialButtonReset(); } }
private void RefreshSpriteLocale(LocalizationReloaded localeChange) { string currentLanguage = localeChange.currentLanguage; string localizedSprite = this.GetLocalizedSprite(currentLanguage); RuntimeSpriteDatabase instance = Singleton <RuntimeSpriteDatabase> .Instance; SpriteData data = instance.Find(localizedSprite); base.gameObject.GetComponent <Sprite>().SelectSprite(data, false); }
private void RefreshPrefabLocale(LocalizationReloaded localeChange) { MonoBehaviour.print("== Language changed: " + localeChange); MonoBehaviour.print("locale: " + localeChange.currentLanguage); string currentLanguage = localeChange.currentLanguage; if (currentLanguage == "zh-CN") { this.updateToons(GameObject.Find("Toons"), this.ToonsPrefab_CN, "Toons"); this.localized = true; } else if (this.localized) { this.updateToons(GameObject.Find("Toons"), this.ToonsPrefab, "Toons"); this.localized = false; } }
private void ReloadLocalization(LocalizationReloaded localizationReloaded) { this.ApplyLocale(null); this.Refresh(); }
private void ReceiveLocalizationReloaded(LocalizationReloaded localizationReloaded) { this.ApplyLocale(null); }