Exemplo n.º 1
0
    public void EvaluateGroupsToggleImmediately(L6A277_grupo 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 <L6A277_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 <L6A277_toggle>().isRight);

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

        //print(z);

        SetPuntaje(answer);
    }
Exemplo n.º 2
0
    void Start()
    {
        _controlAudio  = FindObjectOfType <ControlAudio>();
        _toggle        = GetComponent <Toggle>();
        _L6A277_grupo  = transform.parent.GetComponent <L6A277_grupo>();
        _managerToggle = transform.parent.parent.GetComponent <L6A277_managerSeleccionar>();
        _toggle.onValueChanged.AddListener(delegate { SetStateToggle(); });

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