public void DrawProperty() { this.propertyViewScroll = GUILayout.BeginScrollView(this.propertyViewScroll); { DrawPropertyItem("Name", () => Name = EditorGUILayout.TextField(Name)); DrawPropertyItem("Text", () => Text = EditorGUILayout.TextField(Text)); DrawPropertyItem("Enabled", () => IsEnabled = EditorGUILayout.Toggle(IsEnabled)); this.DrawPropertyOriginal(); } GUILayout.EndScrollView(); if (GUI.changed) { UFStudio.RepaintAll(); } }
void WindowCallback(int id) { UFControl current = this.drawList[id]; if (UFSelection.ActiveControl != current) { GUILayout.Space(-1); } GUILayout.BeginHorizontal(); if (UFSelection.ActiveControl != current) { GUILayout.Space(-3); } GUILayout.Space(current.Nest * 10); if (current.HasChild) { string text = (current.Foldout ? "\u25BC" : "\u25BA"); if (GUILayout.Button(text, EditorStyles.label, GUILayout.Width(13))) { current.Foldout = !current.Foldout; } } else { GUILayout.Label(" ", GUILayout.Width(13)); } GUILayout.Label(current.Name); GUIContent visibleContent = (current.IsHidden ? UFContent.Minus : UFContent.VisibleSwitch); if (GUILayout.Button(visibleContent, EditorStyles.label, GUILayout.Width(20))) { current.IsHidden = !current.IsHidden; } GUILayout.EndHorizontal(); if (GUI.changed) { UFStudio.RepaintAll(); } }