Esempio n. 1
0
    public void SetLevelChallengePreview(ChallengeLog challengeLog, string levelName)
    {
        int challengeCount = challengeLog?.GetChallengeCount() ?? 0;

        if (challengeCount <= 0)
        {
            noChallengeText.gameObject.SetActive(true);
            challengeParent.SetActive(false);
        }
        else
        {
            noChallengeText.gameObject.SetActive(false);
            challengeParent.SetActive(true);

            if (packIndex == -1 || levelIndex == -1)
            {
                Vector2 indexes = LevelParser.GetLevelPackLevelIndexes(levelName);
                packIndex  = (int)indexes.x;
                levelIndex = (int)indexes.y;
            }

            for (int i = 0; i < challengeEntries.Count; i++)
            {
                if (i <= challengeCount - 1)
                {
                    challengeEntries[i].gameObject.SetActive(true);
                    challengeEntries[i].UpdateChallengeEntry(challengeLog.GetChallengeData(i), packIndex, levelIndex);
                }
                else
                {
                    challengeEntries[i].gameObject.SetActive(false);
                }
            }
        }
    }
Esempio n. 2
0
    public void UpdateChallengePreview()
    {
        Vector2      indexes      = LevelParser.GetLevelPackLevelIndexes(LevelLoader.GetLevelName());
        ChallengeLog challengeLog = ChallengeManager.GetCurrentChallengeLog((int)indexes.x, (int)indexes.y);

        challengePreview.SetLevelChallengePreview(challengeLog, LevelLoader.GetLevelName());
    }
Esempio n. 3
0
    public void SetChallengeLog()
    {
        Vector2 indexes = LevelParser.GetLevelPackLevelIndexes(LevelLoader.GetLevelName());

        challengeLog = ChallengeManager.GetCurrentChallengeLog((int)indexes.x, (int)indexes.y);
    }