public static void DrawPropertyDrawerLayout(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)
                    {
                        EditorGUILayout.PropertyField(property);
                    }
                    else
                    {
                        EditorGUILayout.PropertyField(property, GUIContent.none);
                    }
                }
                else
                {
                    PropertyDrawIteratorLayout iter = new PropertyDrawIteratorLayout(property.Copy(), drawLabel);

                    DrawPropertyDrawerInternal(iter);
                }

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

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

                DrawPropertyDrawerInternal(iter);
            }
        }