Ejemplo n.º 1
0
    void showmateri(int i)
    {
        penjelasan.text = "";

        try
        {
            gambar.sprite = Resources.Load <Sprite>("Materi/Gambar/" + materis.materis[i].imageName);
        }
        catch (NullReferenceException e) {
            Debug.Log("File cannot be found. AT " + System.DateTime.Now);
        }
        if (current <= 0)
        {
            prev.transform.gameObject.SetActive(false);
        }
        Debug.Log("Materi/Gambar/" + materis.materis[i].imageName);
        if (lastSaw <= current)
        {
            lastSaw = current;
            scroll.onValueChanged.AddListener(scrollEvent);
            RunningText.runningText(materis.materis[i].Penjelasan, penjelasan, 0.04F, delegate { next.transform.gameObject.SetActive(true); scroll.onValueChanged.RemoveListener(scrollEvent); });
        }
        else
        {
            penjelasan.text = materis.materis[i].Penjelasan;
            next.transform.gameObject.SetActive(true);
        }
    }
Ejemplo n.º 2
0
    public void startQuestion()
    {
        basicGameControl.banUserInput();
        basicGameControl.pauseGame();
        userAnswer           = -1;
        isDOne               = false;
        isQuestionAnswerShow = false;
        int rand;

        startTime = Time.time;
        do
        {
            rand = Random.Range(0, questions.question.Count);
        } while (uni[rand]);
        current       = rand;
        q             = questions.question[rand];
        question.text = "";

        for (int i = 0; i < 3; i++)
        {
            answer[i].transform.GetChild(0).gameObject.GetComponent <Text>().text = q.answers[i];
        }
        supposedAnswer = q.answer;
        foreach (Button b in answer)
        {
            b.gameObject.SetActive(false);
        }
        Parent.GetComponent <Interpolate>().Enable(() => {
            RunningText.runningText(q.question, question, 0.075F, () => {
                foreach (Button b in answer)
                {
                    b.gameObject.SetActive(true);
                }
                isQuestionAnswerShow = true;
            });
        });
    }