コード例 #1
0
        public void Init(int id, ThemeData themeData, GroupData groupData, GroupProgressData progressData)
        {
            Init(id);

            for (int i = 0; i < mainImages.Length; i++)
            {
                mainImages[i].sprite = Resources.Load <Sprite>("Drawings/" + groupData.Images[i]);
            }

            background.color = themeData.GetColor(ThemeData.ColorEnum.BkgSecond);

            locked         = !progressData.Unlocked;
            locker.enabled = locked;

            for (int i = 0; i < stars.Length; i++)
            {
                var star = stars[i];
                star.color = themeData.GetColor(i + 1 <= CalculateGroupStars(progressData) ? ThemeData.ColorEnum.Main : ThemeData.ColorEnum.Second);
            }
        }
コード例 #2
0
        public void Init(int id, ThemeData themeData, DrawingData drawingData, DrawingProgressData progressData)
        {
            Init(id);

            background.color = themeData.GetColor(ThemeData.ColorEnum.BkgSecond);

            if (progressData.Completed)
            {
                mainImage.sprite = Resources.Load <Sprite>("Drawings/" + drawingData.Image);
            }
            else
            {
                questionMark.color = themeData.GetColor(ThemeData.ColorEnum.Second);
            }

            questionMark.enabled = !progressData.Completed;
            mainImage.enabled    = progressData.Completed;

            for (int i = 0; i < stars.Length; i++)
            {
                var star = stars[i];
                star.color = themeData.GetColor(i < progressData.Stars ? ThemeData.ColorEnum.Main : ThemeData.ColorEnum.Second);
            }
        }