UnityEditor.EditorGUILayout.Foldout C# (CSharp) Method

Foldout() private method

private Foldout ( bool foldout, GUIContent content ) : bool
foldout bool
content UnityEngine.GUIContent
return bool
        public static bool Foldout(bool foldout, GUIContent content)
        {
            GUIStyle style = EditorStyles.foldout;
            return Foldout(foldout, content, style);
        }

Same methods

EditorGUILayout::Foldout ( bool foldout, GUIContent content, [ style ) : bool
EditorGUILayout::Foldout ( bool foldout, GUIContent content, bool toggleOnLabelClick ) : bool
EditorGUILayout::Foldout ( bool foldout, GUIContent content, bool toggleOnLabelClick, [ style ) : bool
EditorGUILayout::Foldout ( bool foldout, string content ) : bool
EditorGUILayout::Foldout ( bool foldout, string content, [ style ) : bool
EditorGUILayout::Foldout ( bool foldout, string content, bool toggleOnLabelClick ) : bool
EditorGUILayout::Foldout ( bool foldout, string content, bool toggleOnLabelClick, [ style ) : bool

Usage Example

        void DrawActionButtonArrayElement(SP dialog, int elementIndex)
        {
            DrawArrayElement(dialog, elementIndex, "Consent dialog should have at least 1 button.", MinActionButtonsCount,
                             () => SelectedButtonIndex,
                             param => SelectedButtonIndex = param,
                             obj =>
            {
                var title = obj.FindPropertyRelative("title");

                EditorGUI.indentLevel++;
                string key = obj.propertyPath;

                if (!privacyFoldoutStates.ContainsKey(key))
                {
                    privacyFoldoutStates.Add(key, false);
                }

                string titleValue         = !string.IsNullOrEmpty(title.stringValue) ? title.stringValue : "[Untitled Button]";
                privacyFoldoutStates[key] = EGL.Foldout(privacyFoldoutStates[key], titleValue, true);
                EditorGUI.indentLevel--;

                if (privacyFoldoutStates[key])
                {
                    EGL.PropertyField(obj.FindPropertyRelative("id"));
                    EGL.PropertyField(title);
                    EGL.PropertyField(obj.FindPropertyRelative("interactable"));
                    EGL.PropertyField(obj.FindPropertyRelative("titleColor"));
                    EGL.PropertyField(obj.FindPropertyRelative("backgroundColor"));
                    EGL.PropertyField(obj.FindPropertyRelative("uninteractableTitleColor"));
                    EGL.PropertyField(obj.FindPropertyRelative("uninteractableBackgroundColor"));
                }
            });
        }
All Usage Examples Of UnityEditor.EditorGUILayout::Foldout