Example #1
0
    public void OnClickButtonProblem(ProblemButtonComponent problemButtonComponent)
    {
        this.GenerateLevelsInLevelPanel(problemButtonComponent.GetProblem());

        this.problemChoicePanel.SetActive(false);
        this.levelChoicePanel.SetActive(true);
    }
Example #2
0
    private void GenerateProblemsInProblemPanel()
    {
        for (int i = 0; i < this.problemButtonContainer.transform.childCount; i++)
        {
            Destroy(this.problemButtonContainer.transform.GetChild(i).gameObject);
        }

        foreach (var problem in Player.playerProgressData)
        {
            GameObject newProblemButton = (GameObject)Instantiate(this.problemButtonPrefab, Vector3.zero, this.spawnPosition.transform.rotation);
            newProblemButton.transform.SetParent(this.problemButtonContainer.transform);

            ProblemButtonComponent newProblemButtonComponent = newProblemButton.GetComponent <ProblemButtonComponent>();
            newProblemButtonComponent.SetProblem(problem.Key);
        }
    }