I have 3 toggle buttons to control graphics quality.
To ensure only 1 is active at one time I use the code below:
function OnGUI(){
qualityLow = GUI.Toggle(Rect(guiTexture.pixelInset.x + 15,(Screen.height - guiTexture.pixelInset.y) - 240, 110, 20), qualityLow, "Low");
qualityMed = GUI.Toggle(Rect(guiTexture.pixelInset.x + 15,(Screen.height - guiTexture.pixelInset.y) - 220, 110, 20), qualityMed, "Medium");
qualityHigh = GUI.Toggle(Rect(guiTexture.pixelInset.x + 15,(Screen.height - guiTexture.pixelInset.y) - 200, 110, 20), qualityHigh, "High");
if(qualityLow == true){
qualityMed = false;
qualityHigh = false;
qualityLevelChange = QualityLevel.Fastest;
}
if (qualityMed == true) {
qualityLow = false;
qualityHigh = false;
qualityLevelChange = QualityLevel.Good;
}
if (qualityHigh == true) {
qualityLow = false;
qualityMed = false;
qualityLevelChange = QualityLevel.Fantastic;
}
}
However when I click some toggle buttons it doesnt seem to highlight them and when I click others it seems to select more than 1.
I’m not sure whats going on tbh.
Can anyone help me with this?
Thanks.