Ejemplo n.º 1
0
    public bool CheckAnswerAllBox(Arah arah)
    {
        bool isTrue           = false;
        List <GameObject> box = new List <GameObject>();

        box.Add(this.gameObject);
        switch (arah)
        {
        case Arah.Vertical:
            isTrue = (nextVertical != null ? nextVertical.CheckAnswerAllBox(arah, ref box, true):true) && (prevVertical != null ? prevVertical.CheckAnswerAllBox(arah, ref box, false):true) && _currentAnswer == boxAnswer;
            break;

        case Arah.Horizontal:
            isTrue = (nextHorizontal != null ? nextHorizontal.CheckAnswerAllBox(arah, ref box, true) : true) && (prevHorizontal != null ? prevHorizontal.CheckAnswerAllBox(arah, ref box, false) : true) && _currentAnswer == boxAnswer;
            break;
        }
        Debug.Log("Answer is : " + isTrue);
        if (isTrue)
        {
            foreach (GameObject b in box)
            {
                b.GetComponent <BoxTTS>().wasAnswer = true;
            }
        }
        return(isTrue);
    }
Ejemplo n.º 2
0
    public void CekJawaban()
    {
        if (currentBtts == null)
        {
            return;
        }

        bool result = currentBtts.CheckAnswerAllBox(currentArah);

        Debug.Log(" The Answer : " + result);
        if (result)
        {
            SoundBase.MAIN.PlaySound("JawabanBenar");
            RightSoal.GetChild(1).gameObject.SetActive(true);
        }
        else
        {
            SoundBase.MAIN.PlaySound("JawabanSalah");
        }
    }