void DrawVariables() { if (InkEditorUtils.StoryContainsVariables(story)) { EditorGUILayout.BeginHorizontal(EditorStyles.toolbar); showingVariablesPanel = EditorGUILayout.Foldout(showingVariablesPanel, "Variables"); EditorGUI.BeginDisabledGroup(!showingVariablesPanel); bool changed = DrawSearchBar(ref variablesPanelState.searchString); if (changed) { variablesScrollPosition = Vector2.zero; } EditorGUI.EndDisabledGroup(); EditorGUILayout.EndHorizontal(); if (showingVariablesPanel) { DrawVariablesPanel(); } if (variablesPanelState.observedVariables.Count > 0) { EditorGUILayout.BeginHorizontal(EditorStyles.toolbar); showingObservedVariablesPanel = EditorGUILayout.Foldout(showingObservedVariablesPanel, "Observed Variables"); EditorGUILayout.EndHorizontal(); if (showingObservedVariablesPanel) { DrawObservedVariables(); } } } }
void DrawVariables() { if (InkEditorUtils.StoryContainsVariables(story)) { EditorGUILayout.BeginHorizontal(EditorStyles.toolbar); showingVariablesPanel = EditorGUILayout.Foldout(showingVariablesPanel, "Variables"); EditorGUILayout.EndHorizontal(); if (showingVariablesPanel) { DrawVariablesPanel(); } } }
void OnGUI() { this.Repaint(); scrollPosition = EditorGUILayout.BeginScrollView(scrollPosition); DisplayHeader(); if (errors == null) { DisplayControlbar(); } else { DisplayErrors(); } if (story == null) { EditorGUILayout.EndScrollView(); return; } EditorGUILayout.BeginHorizontal(EditorStyles.toolbar); showingContentPanel = EditorGUILayout.Foldout(showingContentPanel, "Content"); EditorGUILayout.EndHorizontal(); if (showingContentPanel) { DisplayStory(); } EditorGUILayout.BeginHorizontal(EditorStyles.toolbar); showingChoicesPanel = EditorGUILayout.Foldout(showingChoicesPanel, "Choices"); EditorGUILayout.EndHorizontal(); if (showingChoicesPanel) { DisplayChoices(); } EditorGUILayout.BeginHorizontal(EditorStyles.toolbar); showingSaveLoadPanel = EditorGUILayout.Foldout(showingSaveLoadPanel, "Story State"); EditorGUILayout.EndHorizontal(); if (showingSaveLoadPanel) { DisplaySaveLoad(); } EditorGUILayout.BeginHorizontal(EditorStyles.toolbar); showingDivertsPanel = EditorGUILayout.Foldout(showingDivertsPanel, "Diverts"); EditorGUILayout.EndHorizontal(); if (showingDivertsPanel) { DisplayDiverts(); } if (InkEditorUtils.StoryContainsVariables(story)) { EditorGUILayout.BeginHorizontal(EditorStyles.toolbar); showingVariablesPanel = EditorGUILayout.Foldout(showingVariablesPanel, "Variables"); EditorGUILayout.EndHorizontal(); if (showingVariablesPanel) { DisplayVariables(); } } EditorGUILayout.EndScrollView(); }