ToggleLanguage.cs 476 B

12345678910111213141516171819202122232425
  1. using System;
  2. using System.Collections.Generic;
  3. using UnityEngine;
  4. namespace I2.Loc
  5. {
  6. public class ToggleLanguage : MonoBehaviour
  7. {
  8. private void Start()
  9. {
  10. base.Invoke("test", 3f);
  11. }
  12. private void test()
  13. {
  14. List<string> allLanguages = LocalizationManager.GetAllLanguages(true);
  15. int num = allLanguages.IndexOf(LocalizationManager.CurrentLanguage);
  16. if (num >= 0)
  17. {
  18. num = (num + 1) % allLanguages.Count;
  19. }
  20. base.Invoke("test", 3f);
  21. }
  22. }
  23. }