コード例 #1
0
        static IEnumerator Delayed_Import_Google(LanguageSourceData 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);
            }
        }
コード例 #2
0
        internal static void AddSource(LanguageSourceData Source)
        {
            if (Sources.Contains(Source))
            {
                return;
            }

            Sources.Add(Source);

            if (Source.HasGoogleSpreadsheet() && Source.GoogleUpdateFrequency != LanguageSourceData.eGoogleUpdateFrequency.Never && LocalizationManager.AllowSyncFromGoogle(Source))
            {
                #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);
            }
        }