Question by
CCGnomes · Apr 01, 2017 at 04:58 PM ·
guiinspectortogglecustom-inspectortoggle button
Toggling checkbox in toggle in GUILayout.Toggle
I am struggling to figure out how to toggle the checkbox on my Inspector Gui element.
public override void OnInspectorGUI()
{
//DrawDefaultInspector();
Script S = target as Script;
if (GUILayout.Toggle(false,"Show Button"))
{
//Make button toggle here.
S.DropdownToggle = !S.DropdownToggle;
}
//Do stuff for toggle on
if (S.DropdownToggle== true)
{
// or make Checkbox check here
S.distance = EditorGUILayout.Vector3Field ("Vector",S.distance);
EditorGUILayout.LabelField ("Wait Time:");
S.wait = EditorGUILayout.FloatField(S.wait);
}
}
How do I access this toggle?
Comment
Best Answer
Answer by CCGnomes · Apr 05, 2017 at 06:14 PM
Had to use EditorGUILayout.Toggle instead of GUILayout.toggle
Your answer
Follow this Question
Related Questions
Update object properties in editor 0 Answers
Need help understanding toggle code. 0 Answers
Can't get Custom Editor to display 1 Answer
Custom Editor: Array of Structs with elements hidden by toggles 0 Answers
toggle add listener through script 0 Answers