SetLanguage.cs 431 B

123456789101112131415161718192021222324
  1. using System;
  2. using UnityEngine;
  3. namespace I2.Loc
  4. {
  5. [AddComponentMenu("I2/Localization/SetLanguage Button")]
  6. public class SetLanguage : MonoBehaviour
  7. {
  8. private void OnClick()
  9. {
  10. this.ApplyLanguage();
  11. }
  12. public void ApplyLanguage()
  13. {
  14. if (LocalizationManager.HasLanguage(this._Language, true, true, true))
  15. {
  16. LocalizationManager.CurrentLanguage = this._Language;
  17. }
  18. }
  19. public string _Language;
  20. }
  21. }