示例#1
0
    public virtual void Refresh()
    {
        foreach (Transform t in content)
        {
            Destroy(t.gameObject);
        }
        for (int i = 0; i < PlayerData.starNumberPerLevel.Count; i++)
        {
            int playerLevelData = PlayerData.starNumberPerLevel[i];

            LevelUI ui = LevelUI.Instantiate(LevelUIPrefab, content);
            ui.onClicked.AddListener(UIClicked);
            //Debug.Log('v');
            Level level = ui.gameObject.GetComponent <Level>();
            level.index = i;
            level.stars = playerLevelData;
            ui.Display(level);
            if (!UnlockAllLevels)
            {
                if (level.stars == 0)
                {
                    break;
                }
            }
        }
    }