Example_ChangeLanguage.cs 527 B

12345678910111213141516171819202122232425262728293031
  1. using System;
  2. using UnityEngine;
  3. namespace I2.Loc
  4. {
  5. public class Example_ChangeLanguage : MonoBehaviour
  6. {
  7. public void SetLanguage_English()
  8. {
  9. this.SetLanguage("English");
  10. }
  11. public void SetLanguage_French()
  12. {
  13. this.SetLanguage("French");
  14. }
  15. public void SetLanguage_Spanish()
  16. {
  17. this.SetLanguage("Spanish");
  18. }
  19. public void SetLanguage(string LangName)
  20. {
  21. if (LocalizationManager.HasLanguage(LangName, true, true, true))
  22. {
  23. LocalizationManager.CurrentLanguage = LangName;
  24. }
  25. }
  26. }
  27. }