public void LoadLanguage(dfLanguageCode language, bool forceReload = false) { if (I18N.CurrentUIDict == null) { orig_LoadLanguage(language, forceReload); } else { strings = I18N.CurrentUIDict; if (forceReload) { dfControl[] componentsInChildren = base.GetComponentsInChildren <dfControl>(); for (int i = 0; i < componentsInChildren.Length; i++) { componentsInChildren[i].Localize(); } for (int j = 0; j < componentsInChildren.Length; j++) { componentsInChildren[j].PerformLayout(); if (componentsInChildren[j].LanguageChanged != null) { componentsInChildren[j].LanguageChanged(componentsInChildren[j]); } } } } }
public void Load() { if (File.Exists(Application.persistentDataPath + "/playerInfo.dat")) { BinaryFormatter bf = new BinaryFormatter(); FileStream file = File.Open(Application.persistentDataPath + "/playerInfo.dat", FileMode.Open); try { GameInfo i = (GameInfo)bf.Deserialize(file); Debug.Log("Loaded \'" + Application.persistentDataPath + "/playerInfo.dat\'"); i.bonuses.Load(); bonuses = i.bonuses; GameManager.Instance.CollectionInitializedEvent(bonuses); completedLevels = i.completedLevels; lang = i.lang; } catch (Exception) { Debug.Log("Created new info. (Catched exception in Deserialize())"); Reset(); } file.Close(); } else { Debug.Log("File \'" + Application.persistentDataPath + "/playerInfo.dat\' isn't exist"); Reset(); } }
public void Reset() { bonuses = new BonusCollection(); completedLevels = 0; lang = dfLanguageCode.EN; Debug.Log("info reseted"); GameManager.Instance.CollectionInitializedEvent(bonuses); }
public void Start() { dfLanguageCode languageCode = this.currentLanguage; if (this.currentLanguage == dfLanguageCode.None) { languageCode = this.SystemLanguageToLanguageCode(Application.systemLanguage); } this.LoadLanguage(languageCode); }
public void LoadLanguage(dfLanguageCode language) { this.currentLanguage = language; this.strings.Clear(); if (this.dataFile != null) { this.parseDataFile(); } dfControl[] componentsInChildren = base.GetComponentsInChildren <dfControl>(); for (int i = 0; i < (int)componentsInChildren.Length; i++) { componentsInChildren[i].Localize(); } }
public void LoadLanguage(dfLanguageCode language) { this.currentLanguage = language; this.strings.Clear(); if (this.dataFile != null) { this.parseDataFile(); } dfControl[] componentsInChildren = base.GetComponentsInChildren<dfControl>(); for (int i = 0; i < (int)componentsInChildren.Length; i++) { componentsInChildren[i].Localize(); } }
/// <summary> /// Loads the indicated language from the data file /// </summary> /// <param name="language">The language code representing the language data to be loaded</param> public void LoadLanguage(dfLanguageCode language) { // Keep track of the current language this.currentLanguage = language; // Start from a clean slate strings.Clear(); if (dataFile != null) { parseDataFile(); } // When the language is loaded, localize all controls var controls = GetComponentsInChildren <dfControl>(); for (int i = 0; i < controls.Length; i++) { controls[i].Localize(); } }
public extern void orig_LoadLanguage(dfLanguageCode language, bool forceReload = false);
public GameInfo() { bonuses = new BonusCollection(); completedLevels = 0; lang = dfLanguageCode.EN; }
/// <summary> /// Loads the indicated language from the data file /// </summary> /// <param name="language">The language code representing the language data to be loaded</param> public void LoadLanguage( dfLanguageCode language ) { // Keep track of the current language this.currentLanguage = language; // Start from a clean slate strings.Clear(); if( dataFile != null ) { parseDataFile(); } // When the language is loaded, localize all controls var controls = GetComponentsInChildren<dfControl>(); for( int i = 0; i < controls.Length; i++ ) { controls[ i ].Localize(); } }