Esempio n. 1
0
        private void Foldout(CacheFoldProp cache)
        {
            cache.expanded = EditorGUILayout.Foldout(cache.expanded, cache.atr.name, true,
                                                     StyleFramework.foldout);

            if (cache.expanded)
            {
                EditorGUI.indentLevel = 1;

                for (int i = 0; i < cache.props.Count; i++)
                {
                    this.UseVerticalLayout(() => Child(i, cache.props[i]), StyleFramework.boxChild);
                }
            }
        }
        private void Foldout(CacheFoldProp cache)
        {
            cache.expanded = EditorGUILayout.Foldout(cache.expanded, cache.atr.name, true,
                                                     StyleFramework.Foldout);

            if (cache.expanded)
            {
                EditorGUI.indentLevel = 1;

                for (int i = 0; i < cache.props.Count; i++)
                {
                    EditorGUILayout.BeginVertical(StyleFramework.BoxChild);
                    EditorGUILayout.PropertyField(cache.props[i], new GUIContent(cache.props[i].name.FirstLetterToUpperCase()), true);
                    EditorGUILayout.EndVertical();
                }
            }
        }
Esempio n. 3
0
        private void Foldout(CacheFoldProp cache)
        {
            cache.Expanded = EditorGUILayout.Foldout(cache.Expanded, cache.Attribute.Name, true, StyleFramework.FoldoutHeader);
            var rect = GUILayoutUtility.GetLastRect();

            rect.x      -= 18;
            rect.y      -= 4;
            rect.height += 8;
            rect.width  += 22;
            EditorGUI.LabelField(rect, GUIContent.none, EditorStyles.helpBox);

            if (cache.Expanded)
            {
                EditorGUILayout.Space(2);

                foreach (var property in cache.Properties)
                {
                    EditorGUILayout.BeginVertical(StyleFramework.BoxChild);
                    EditorGUILayout.PropertyField(property, new GUIContent(ObjectNames.NicifyVariableName(property.name)), true);
                    EditorGUILayout.EndVertical();
                }
            }
        }