//// Instancia el puntaje y audio, al validar por boton
    void SetPuntaje()
    {
        Element.GetComponent <M10L33_element>().GetQuestion();
        if (_TypeCalification == TypeCalification.grupo)
        {
            if (rights == _groupToggle.Count)
            {
                background.SetActive(false);
                rightImage.SetActive(true);
                _controlAudio.PlayAudio(1);
                _validarBTN.gameObject.SetActive(false);
                _general.AddGifts(level);
                _controlPuntaje.IncreaseScore();
            }
            else
            {
                background.SetActive(false);
                wrongImag.SetActive(true);
                _controlAudio.PlayAudio(2);
                _validarBTN.gameObject.SetActive(false);
                _general.RestLifes();
            }
        }

        //_controlAudio.PlayAudio(rights == _groupToggle.Count ? 1 : 2);
        else
        {
            if (rights == 1)
            {
                background.SetActive(false);
                rightImage.SetActive(true);
                _controlAudio.PlayAudio(1);
                _validarBTN.gameObject.SetActive(false);
                _general.AddGifts(level);
                _controlPuntaje.IncreaseScore();
            }
            else
            {
                _controlAudio.PlayAudio(2);
                _validarBTN.gameObject.SetActive(false);
                _general.RestLifes();
            }
        }

        //_controlAudio.PlayAudio(rights == _groupToggle[0]._sizeCorrect ? 1 : 2);

        //_controlPuntaje.IncreaseScore(rights);

//        StartCoroutine(a());
    }
示例#2
0
    IEnumerator x(bool valueImage)
    {
        yield return(new WaitForSeconds(1));

        if (valueImage)
        {
            background.SetActive(false);
            rightImage.SetActive(true);
        }
        else
        {
            background.SetActive(false);
            wrongImage.SetActive(true);
            _general.RestLifes();
        }
        yield return(new WaitForSeconds(2));

        Element.GetComponent <M10L33_element>().GetQuestion();
        _player.canMove = true;
        _player.x       = 0;

        rightImage.SetActive(false);
        wrongImage.SetActive(false);
        background.transform.parent.gameObject.SetActive(false);
    }