public static void DrawPropertyDrawer(Rect rect, SerializedProperty property, Type type, bool drawLabel = true)
        {
            if (property == null)
            {
                Debug.LogError(NullPropertyText);
                return;
            }

            using (var scope = new EditorGUI.ChangeCheckScope())
            {
                if (SOArchitecture_EditorUtility.HasPropertyDrawer(type))
                {
                    if (drawLabel)
                    {
                        EditorGUI.PropertyField(rect, property);
                    }
                    else
                    {
                        EditorGUI.PropertyField(rect, property, GUIContent.none);
                    }
                }
                else
                {
                    PropertyDrawIterator iter = new PropertyDrawIterator(rect, property.Copy(), drawLabel);

                    DrawPropertyDrawerInternal(iter);
                }

                if (scope.changed)
                {
                    EditorUtility.SetDirty(property.serializedObject.targetObject);
                }
            }
        }
Example #2
0
        public static void DrawPropertyDrawer(Rect rect, SerializedProperty property, Type type, bool drawLabel = true)
        {
            if (property == null)
            {
                Debug.LogError(NullPropertyText);
                return;
            }

            if (SOArchitecture_EditorUtility.HasPropertyDrawer(type))
            {
                if (drawLabel)
                {
                    EditorGUI.PropertyField(rect, property);
                }
                else
                {
                    EditorGUI.PropertyField(rect, property, GUIContent.none);
                }
            }
            else
            {
                PropertyDrawIterator iter = new PropertyDrawIterator(rect, property.Copy(), drawLabel);

                DrawPropertyDrawerInternal(iter);
            }
        }