public void EvaluateGroupsToggleImmediately(M7A119_groupSeleccionar completed) { bool answer = false; int indexGroup = _groupToggle.IndexOf(completed); for (int i = 0; i < _groupToggle[indexGroup].transform.childCount; i++) { _groupToggle[indexGroup].transform.GetChild(i).GetComponent <Toggle>().interactable = false; Image img = _groupToggle[indexGroup].transform.GetChild(i).GetComponent <Image>(); bool state = _groupToggle[indexGroup].transform.GetChild(i).GetComponent <M7A119_toggle>().isRight; bool isON = _groupToggle[indexGroup].transform.GetChild(i).GetComponent <Toggle>().isOn; if (_TypeQualify == TypeQualify.all) { SetSpriteAnswer(img, state); } else if (isON) { SetSpriteAnswer(img, state); } } Toggle t = _groupToggle[indexGroup].GetComponent <ToggleGroup>().ActiveToggles().FirstOrDefault(); answer = (t.isOn && t.GetComponent <M7A119_toggle>().isRight); string z = ("Grupo" + _groupToggle[indexGroup].name + "select" + t.name + "is" + answer); //print(z); SetPuntaje(answer); }
void Start() { _controlAudio = FindObjectOfType<ControlAudio>(); _toggle = GetComponent<Toggle>(); _M7A119_groupSeleccionar = transform.parent.GetComponent<M7A119_groupSeleccionar>(); _managerToggle = transform.parent.parent.GetComponent<M7A119_managerSeleccionar>(); _toggle.onValueChanged.AddListener(delegate { SetStateToggle(); }); if (_managerToggle._NeedSymbol == M7A119_managerSeleccionar.NeedSymbol.withSymbol) transform.GetChild(0).gameObject.SetActive(false); }