hellbound/Assets/Sources/I2/Localization/Examples/Common/Scripts/ToggleLanguage.cs

29 lines
568 B
C#
Raw Permalink Normal View History

2021-11-26 11:16:25 +03:00
using System.Collections.Generic;
using UnityEngine;
namespace I2.Loc
{
public class ToggleLanguage : MonoBehaviour
{
void Start ()
{
Invoke("test", 3);
}
void test()
{
//-- to move into the next language ----
List<string> languages = LocalizationManager.GetAllLanguages();
int Index = languages.IndexOf(LocalizationManager.CurrentLanguage);
if (Index<0)
Index = 0;
else
Index = (Index+1) % languages.Count;
//-- Call this function again in 3 seconds
Invoke("test", 3);
}
}
}