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 override void UnloadContent()
        {
            base.UnloadContent();


            PromptUser = null;
            AudioManager.StopAll_Music();
        }
Ejemplo n.º 3
0
    public static Coroutine runningText(string stext, Text text, float deltaTime, UnityAction action)
    {
        GameObject  parent = new GameObject("RunningText");
        RunningText r      = parent.AddComponent <RunningText>();

        list.Add(r);
        return(r.StartCoroutine(runText(parent, stext, deltaTime, text, action)));
    }
Ejemplo n.º 4
0
    static IEnumerator runText(GameObject parent, string stext, float dTime, Text text)
    {
        RunningText r = parent.GetComponent <RunningText>();

        r.deltaTime = dTime;
        for (int i = 0; i < stext.Length; i++)
        {
            text.text += stext[i];
            yield return(new WaitForSecondsRealtime(r.realDeltaTime));
        }
        Destroy(parent);
        list.Remove(parent.GetComponent <RunningText>());
    }
Ejemplo n.º 5
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;
            });
        });
    }