Beispiel #1
0
    public void EvaluateGroupsToggleImmediately(L10A190_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 <L10A190_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 <L10A190_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>();
        _L10A190_groupSeleccionar = transform.parent.GetComponent <L10A190_groupSeleccionar>();
        _managerToggle            = transform.parent.parent.GetComponent <L10A190_managerSeleccionar>();
        _toggle.onValueChanged.AddListener(delegate { SetStateToggle(); });

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