浏览代码

added checks for localization only when either the UX manager or Reasons manger is localized

/main
Dan 4 年前
当前提交
2f26027b
共有 1 个文件被更改,包括 22 次插入6 次删除
  1. 28
      Assets/UX/Scripts/LocalizationManager.cs

28
Assets/UX/Scripts/LocalizationManager.cs


IEnumerator Start()
{
yield return LocalizationSettings.InitializationOperation;
bool m_LocalizeAnimation = false;
bool m_LocalizeReasons = false;
LocalizationSettings.AvailableLocales.Locales.Sort();
LocalizationSettings.SelectedLocale = LocalizationSettings.AvailableLocales.Locales[(int)CurrentLocalizedLanguage];
SwapFonts(CurrentLocalizedLanguage);
LocalizationSettings.StringDatabase.GetTableAsync(k_ReasonUxTable).Completed += OnCompletedReasonsUX;
if (TryGetComponent(out ARUXAnimationManager m_AnimationManager))
{
m_LocalizeAnimation = m_AnimationManager.localizeText;
}
if (TryGetComponent(out ARUXReasonsManager m_ReasonsManager))
{
m_LocalizeReasons = m_ReasonsManager.localizeText;
}
if (m_LocalizeAnimation || m_LocalizeReasons)
{
yield return LocalizationSettings.InitializationOperation;
LocalizationSettings.AvailableLocales.Locales.Sort();
LocalizationSettings.SelectedLocale = LocalizationSettings.AvailableLocales.Locales[(int)CurrentLocalizedLanguage];
SwapFonts(CurrentLocalizedLanguage);
LocalizationSettings.StringDatabase.GetTableAsync(k_ReasonUxTable).Completed += OnCompletedReasonsUX;
}
}
void OnCompletedReasonsUX(AsyncOperationHandle<StringTable> obj)

正在加载...
取消
保存