hellbound/Assets/Sources/I2/Localization/Scripts/Utils/SetLanguage.cs

27 lines
471 B
C#
Raw Permalink Normal View History

2021-11-26 11:16:25 +03:00
using UnityEngine;
namespace I2.Loc
{
[AddComponentMenu("I2/Localization/SetLanguage Button")]
public class SetLanguage : MonoBehaviour
{
public string _Language;
#if UNITY_EDITOR
public LanguageSource mSource;
#endif
void OnClick()
{
ApplyLanguage();
}
public void ApplyLanguage()
{
if( LocalizationManager.HasLanguage(_Language))
{
LocalizationManager.CurrentLanguage = _Language;
}
}
}
}