09-08-2019 07:56 AM
void Start(){
var ui = DebugUIBuilder.instance.AddLabel("My Test"); //getting the RectTransform transform ui here so i can target it
DebugUIBuilder.instance.AddDivider();
DebugUIBuilder.instance.AddRadio("ContentRight", "group", delegate (Toggle t) { RadioPressed("ContentRight", "group", t, ui); }); //include the ui
DebugUIBuilder.instance.AddRadio("ContentLeft1", "group", delegate (Toggle t) { RadioPressed("ContentLeft01", "group", t, ui); });
DebugUIBuilder.instance.AddLabel("ContentRight Panel", 1);
DebugUIBuilder.instance.AddLabel("ContentLeft01 panel", 2);
}
public void RadioPressed(string radioLabel, string group, Toggle t, RectTransform ui)// add ui parameter
{
ui.parent.parent.Find(radioLabel).gameObject.SetActive(t.isOn);//this works only on panels that have not had a name change
}
09-09-2019 09:08 AM