Beispiel #1
0
    public override void ActionToDoWhenPageShowed()
    {
        GameManager.Instance.pagesManager.ShowLoadingPage();
        selectQuizzScrollerController.Reset();
        selectQuizzScrollerController.Initialize();


        Quizzes quizzes = GameManager.Instance.GetApiManager().GetQuizzes();

        if (quizzes == null)
        {
            Debug.LogError("[WARNING]: quizzes is equal to null. Is your QuizzesData superclass class configured in the same way the API (json) data is ?");
            PopupManager.PopupAlert("Error", "Quizzes is equal to null (is data from API valid ?).\n" + NetworkRequestManager.lastHttpWebRequestErrorMessage);
        }

        // Put each quizz to the scroller
        foreach (Quizz quizz in quizzes.GetQuizzesList())
        {
            selectQuizzScrollerController.AddDataToScroller(quizz.Clone() as Quizz);
        }

        GameManager.Instance.pagesManager.HideLoadingPage();
    }