public void EvaluateGroupsToggleImmediately(L4A255_groupToggle 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 <L4A255_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 <L4A255_toggle>().isRight);

        string z = ("Grupo" + _groupToggle[indexGroup].name + "select" + t.name + "is" + answer);

        //print(z);

        SetPuntaje(answer);
    }
Beispiel #2
0
    void Start()
    {
        _controlAudio       = FindObjectOfType <ControlAudio>();
        _toggle             = GetComponent <Toggle>();
        _L4A255_groupToggle = transform.parent.GetComponent <L4A255_groupToggle>();
        _managerToggle      = transform.parent.parent.GetComponent <L4A255_managerToggle>();
        _toggle.onValueChanged.AddListener(delegate { SetStateToggle(); });

        if (_managerToggle._NeedSymbol == L4A255_managerToggle.NeedSymbol.withSymbol)
        {
            transform.GetChild(0).gameObject.SetActive(false);
        }
    }