UnityEditor.StructPropertyGUILayout.GetChildrenCount C# (CSharp) Method

GetChildrenCount() static private method

static private GetChildrenCount ( UnityEditor.SerializedProperty property ) : int
property UnityEditor.SerializedProperty
return int
        internal static int GetChildrenCount(SerializedProperty property)
        {
            int num = 0;
            SerializedProperty x = property.Copy();
            SerializedProperty endProperty = x.GetEndProperty();
            while (!SerializedProperty.EqualContents(x, endProperty))
            {
                num++;
                x.NextVisible(true);
            }
            return num;
        }
    }

Usage Example

Exemplo n.º 1
0
        internal static void GenericStruct(SerializedProperty property, params GUILayoutOption[] options)
        {
            float num  = 16f + 16f * (float)StructPropertyGUILayout.GetChildrenCount(property);
            Rect  rect = GUILayoutUtility.GetRect(EditorGUILayout.kLabelFloatMinW, EditorGUILayout.kLabelFloatMaxW, num, num, EditorStyles.layerMaskField, options);

            StructPropertyGUI.GenericStruct(rect, property);
        }
StructPropertyGUILayout