using UnityEditor;
using UnityEngine;

namespace Assets.Source.Editor.Utils
{
    public static class EditorCustomUtils
    {
        public static void DrawObjectEditor(SerializedObject obj, params GUILayoutOption[] options)
        {
            GUILayout.BeginVertical();
            var prop = obj.GetIterator();
            prop.NextVisible(true);
            while (prop.NextVisible(false))
            {
                obj.Update();
                EditorGUILayout.PropertyField(prop, true, options);
                obj.ApplyModifiedProperties();
            }
            GUILayout.EndVertical();
        }
    }
}
