public void updateLoadedLevels(SeasonMeta _season)
    {
        List <LevelMeta> loadedLevels = _season.levelList;

        //TODO: remove previous loaded levels
        foreach (Transform child in LevelButtonContainer.transform)
        {
            Destroy(child.gameObject);
        }
        foreach (LevelMeta _level in loadedLevels)
        {
            GameObject  newSeasonButton = Instantiate(TemplateLevelButton, LevelButtonContainer.transform);
            LevelButton levelButton     = newSeasonButton.GetComponent <LevelButton>();
            levelButton.SetTargetLevel(_level, _season.id);
        }
    }
示例#2
0
 public void SetTargetSeason(SeasonMeta _season)
 {
     targetSeason   = _season;
     levelName.text = targetSeason.title;
 }