Esempio n. 1
0
    private void LoadLanguage(GameData.Languages newLanguage)
    {
        if (m_localizations == null)
        {
            ReadLocalizations();
        }

        m_localization = m_localizations[(int)newLanguage];
    }
Esempio n. 2
0
    public void ChangeLanguage(GameData.Languages newLanguage)
    {
        SetLanguageFont(newLanguage.ToString().ToLowerInvariant());
        LoadLanguage((GameData.Languages)currentFont);
        int count = m_iLabels.Count;

        for (int i = 0; i < count; i++)
        {
            m_iLabels[i].Restart();
        }
    }
Esempio n. 3
0
    public override void Awake()
    {
        base.Awake();

        RestartLabelLists();
        m_localization = new Dictionary <string, string>();

        GameData.Languages lang = GameData.Languages.English;

        for (int i = 0; i < font.Count; i++)
        {
            if (font[i].name.ToString().ToLower() == Application.systemLanguage.ToString().ToLower())
            {
                lang = (GameData.Languages)i;
            }
        }

        if (PlayerPrefs.GetInt("Language") != -1)
        {
            lang = (GameData.Languages)PlayerPrefs.GetInt("Language");
        }

        ChangeLanguage(lang);
    }