/// <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(M6L107_drag drag, M6L107_drop drop) { answers.Add(drag.gameObject, drag._DropRight.Contains(drop)); answers.Add(drop.gameObject, drop._drag.GetComponent <M6L107_drag>()._DropRight.Contains(drop)); evaluated++; SetTypeCalification(); }
/// <summary> /// Obtiene las respuestas correstas e instancia el audio y puntaje correspondiente /// </summary> public void SetPuntaje() { rights = 0; foreach (var answer in answers) { M6L107_drag temp = answer.Key.GetComponent <M6L107_drag>(); if (temp) { temp.enabled = false; if (answer.Value) { temp.op = true; rights++; } } } if (_TypeValidation == TypeValidation.Inmediata) { if (rights == 1) { answers.Clear(); rights = 0; if (evaluated == _drags.Count) { //player.GetComponent<Animator>().enabled = true; //player.GetComponent<M6L107_Castel>().e = true; _controlPuntaje.IncreaseScore(); _controlAudio.PlayAudio(1); StartCoroutine(x(goT, seg)); } } else { _controlAudio.PlayAudio(2); v--; if (v < vidas.transform.childCount && v != 0) { vidas.transform.GetChild(v).gameObject.SetActive(false); ResetDragDrop_1(); evaluated = 0; } if (v == 0) { StartCoroutine(x(goF, 2)); } } //_controlNavegacion.Forward(2); } else { if (_customValidar == 0) { if (rights == _drags.Count) { _controlPuntaje.IncreaseScore(); _controlAudio.PlayAudio(1); StartCoroutine(x(goT, seg)); } else { _controlAudio.PlayAudio(2); v--; if (v < vidas.transform.childCount && v != 0) { vidas.transform.GetChild(v).gameObject.SetActive(false); StartCoroutine(y()); //ResetDragDrop_1(); evaluated = 0; } if (v == 0) { StartCoroutine(x(goF, 2)); } } } else { if (rights == _drags.Count) { _controlPuntaje.IncreaseScore(); _controlAudio.PlayAudio(1); StartCoroutine(x(goT, seg)); } else { _controlAudio.PlayAudio(2); v--; if (v < vidas.transform.childCount && v != 0) { vidas.transform.GetChild(v).gameObject.SetActive(false); //ResetDragDrop_1(); StartCoroutine(y()); evaluated = 0; } if (v == 0) { StartCoroutine(x(goF, 2)); } } } //_controlPuntaje.IncreaseScore(rights); //_controlNavegacion.Forward(2); } }