internal static void AddSource(LanguageSource Source) { if (Sources.Contains(Source)) { return; } Sources.Add(Source); #if !UNITY_EDITOR || I2LOC_AUTOSYNC_IN_EDITOR if (Source.HasGoogleSpreadsheet() && Source.GoogleUpdateFrequency != LanguageSource.eGoogleUpdateFrequency.Never) { Source.Import_Google_FromCache(); if (Source.GoogleUpdateDelay > 0) { CoroutineManager.Start(Delayed_Import_Google(Source, Source.GoogleUpdateDelay)); } else { Source.Import_Google(); } } #endif if (Source.mDictionary.Count == 0) { Source.UpdateDictionary(true); } }
static IEnumerator Delayed_Import_Google(LanguageSource source, float delay, bool justCheck) { yield return(new WaitForSeconds(delay)); if (source != null) // handle cases where the source is already deleted { source.Import_Google(false, justCheck); } }
internal static void AddSource(LanguageSource Source) { if (Sources.Contains(Source)) { return; } Sources.Add(Source); #if !UNITY_EDITOR Source.Import_Google(); #endif if (Source.mDictionary.Count == 0) { Source.UpdateDictionary(true); } }
internal static void AddSource(LanguageSource Source) { if (Sources.Contains(Source)) { return; } Sources.Add(Source); if (Source.HasGoogleSpreadsheet() && Source.GoogleUpdateFrequency != LanguageSource.eGoogleUpdateFrequency.Never) { #if !UNITY_EDITOR Source.Import_Google_FromCache(); bool justCheck = false; #else bool justCheck = true; #endif if (Source.GoogleUpdateDelay > 0) { CoroutineManager.Start(Delayed_Import_Google(Source, Source.GoogleUpdateDelay, justCheck)); } else { Source.Import_Google(false, justCheck); } } //if (force) { for (int i = 0; i < Source.mLanguages.Count(); ++i) { Source.mLanguages[i].SetLoaded(true); } } if (Source.mDictionary.Count == 0) { Source.UpdateDictionary(true); } }
internal static void AddSource(LanguageSource Source) { if (Sources.Contains(Source)) { return; } Sources.Add(Source); #if !UNITY_EDITOR || I2LOC_AUTOSYNC_IN_EDITOR Source.Import_Google_FromCache(); if (Source.GoogleUpdateDelay > 0) { Source.Invoke("Delayed_Import_Google", Source.GoogleUpdateDelay); } else { Source.Import_Google(); } #endif if (Source.mDictionary.Count == 0) { Source.UpdateDictionary(true); } }
internal static void AddSource(LanguageSource Source) { if (Sources.Contains(Source)) { return; } Sources.Add(Source); if (Source.HasGoogleSpreadsheet() && Source.GoogleUpdateFrequency != LanguageSource.eGoogleUpdateFrequency.Never) { Source.Import_Google_FromCache(); if (Source.GoogleUpdateDelay > 0f) { CoroutineManager.pInstance.StartCoroutine(Delayed_Import_Google(Source, Source.GoogleUpdateDelay)); } else { Source.Import_Google(); } } if (Source.mDictionary.Count == 0) { Source.UpdateDictionary(force: true); } }
static IEnumerator Delayed_Import_Google(LanguageSource source, float delay) { yield return(new WaitForSeconds(delay)); source.Import_Google(); }
static IEnumerator Delayed_Import_Google(LanguageSource source, float delay, bool justCheck) { yield return(new WaitForSeconds(delay)); source.Import_Google(false, justCheck); }