示例#1
0
    void InitializeItemView(GameObject viewGameObject, TeoriesItemModel model)
    {
        TeoriesItemView view = new TeoriesItemView(viewGameObject.transform);

        view.textTitle.text = model.title;
        view.tButton.GetComponentInChildren <Text>().text = model.buttonText;
        view.tButton.onClick.AddListener(
            () =>
        {
            Scene scene = SceneManager.GetActiveScene();
            if (scene.name == "Theory")
            {
                TheoryDetail.id = model.id;
                Debug.Log("clicked" + model.id);
                SceneManager.LoadScene(7);
            }
            else if (scene.name == "Test")
            {
                TestLabel.id   = model.id;
                TestLabel.name = model.title;
                SceneManager.LoadScene(9);
            }
        }
            );
    }
示例#2
0
    void InitializeItemView(GameObject viewGameObject, TeoriesItemModel model)
    {
        TeoriesItemView view = new TeoriesItemView(viewGameObject.transform);

        view.textGiven.text    = model.given;
        view.textButtonM.text  = model.mButtonText;
        view.textButtonL.text  = model.lbuttonText;
        view.textLabelM.text   = model.mLabelText;
        view.textLabell.text   = model.lLabelText;
        view.textSolution.text = model.solution;
        view.textAnswer.text   = model.answer;
        StartCoroutine(LoadImage(view.imgSolution, model.solutionImg));

        /* view.Check.onClick.AddListener(
         *  () =>
         *  {
         *      if (view.InputAnswer.text.ToLower().Equals(model.answer.ToLower()))
         *      {
         *          view.Error.text = "Rigth";
         *          view.Error.color = Color.green;
         *          view.RightAnswer.enabled = true;
         *      }
         *      else
         *      {
         *          view.RightAnswer.enabled = false;
         *          view.Error.text = "Error";
         *          view.Error.color = Color.red;
         *      }
         *      Debug.Log(view.InputAnswer.text);
         *      Debug.Log(model.answer);
         *
         *      Console.Write(model.answer);
         *  }
         *  );*/
    }