コード例 #1
0
 /// <summary>
 /// Recibe el drag y drop interactuados,y los agrega a un diccionario con su estado de respuesta
 /// </summary>
 /// <param name="drag"></param>
 /// <param name="drop"></param>
 public void ImmediatelyValidation(M7A118_drag drag, M7A118_drop drop)
 {
     answers.Add(drag.gameObject, drag._DropRight.Contains(drop));
     answers.Add(drop.gameObject, drop._drag.GetComponent <M7A118_drag>()._DropRight.Contains(drop));
     evaluated++;
     SetTypeCalification();
 }
コード例 #2
0
    /// <summary>
    /// Obtiene las respuestas correstas e instancia el audio y puntaje correspondiente
    /// </summary>
    public void SetPuntaje()
    {
        rights = 0;

        foreach (var answer in answers)
        {
            M7A118_drag temp = answer.Key.GetComponent <M7A118_drag>();

            if (temp)
            {
                temp.enabled = false;

                if (answer.Value)
                {
                    rights++;
                }
            }
        }

        if (_TypeValidation == TypeValidation.Inmediata)
        {
            _controlAudio.PlayAudio((rights == 1) ? 1 : 2);
            _controlPuntaje.IncreaseScore();
            answers.Clear();
            rights = 0;

            if (evaluated == _drags.Count)
            {
            }
            _controlNavegacion.Forward(2);
        }
        else
        {
            if (_customValidar == 0)
            {
                if (rights == _drags.Count)
                {
                    general.Calificar(valor, true);
                    _controlAudio.PlayAudio(1);
                }
                else
                {
                    general.Calificar(valor, false);
                    _controlAudio.PlayAudio(2);
                }
            }
            else
            {
                if (rights == _customValidar)
                {
                    general.Calificar(valor, true);
                    _controlAudio.PlayAudio(1);
                }
                else
                {
                    general.Calificar(valor, false);
                    _controlAudio.PlayAudio(2);
                }
            }


            _controlPuntaje.IncreaseScore(rights);
            _controlNavegacion.Forward(2);
        }
    }