Exemple #1
0
    void Start()
    {
        AdvancedSelector.ResetState();

        playerData = PlayerData.ReadAllData();

        AdvancedSelector.Subscribe("playerSelector", playerDisplay.Switch);

        foreach (PlayerData data in playerData)
        {
            GameObject       ob  = Instantiate(playerSelector, transform);
            AdvancedSelector adv = ob.GetComponent <AdvancedSelector>();

            adv.data = data.Snowflake;

            ob.transform.Find("Name").GetComponent <Text>().text       = data.name;
            ob.transform.Find("LevelClass").GetComponent <Text>().text = "Level " + data.level + " " + i18n.Translate(data.ClassName);
        }
    }
    private void Start()
    {
        AdvancedSelector.ResetState();

        foreach (I18n.Language lang in i18n.languages.Values)
        {
            GameObject       ob  = Instantiate(languageSelector, transform);
            AdvancedSelector adv = ob.GetComponent <AdvancedSelector>();

            adv.data = lang.id;
            Text txt = adv.GetComponentInChildren <Text>();
            txt.text = txt.text.Replace("#LangName", lang.name).Replace("#LangCode", lang.id);

            if (lang.id == i18n.currentLanguage.id)
            {
                adv.Select();
            }
        }

        AdvancedSelector.Subscribe("lang", Select);
    }