Alterar o valor da alternância

public void valueChanged(Toggle t)
    {
        if (t.isOn) {
            t.GetComponentInChildren<Text> ().text = "Toggle is on";
        } else {
            t.GetComponentInChildren<Text> ().text = "Toggle is off";
        }
    }
Shivam Abhiwan