/**************************************************** 
 文件：EditorWindowLayout.cs
 作者：张铮
 邮箱：834207172@qq.com
 日期：2022/3/3 17:53:52
 功能：
*****************************************************/
using UnityEditor;
using UnityEngine;
namespace Stary.Evo.Editor    
{
    public class EditorWindowLayout : UnoEditorLayout
    {
        public EditorWindowLayout(EditorWindow win)
        {
            _win = win;
            Margin = new Vector4(2, 2, 2, 2);
            IndentSize = 12;
        }

        private readonly EditorWindow _win;

        public Vector4 Margin { get; set; }

        public void Begin()
        {
            var rect = new Rect(Margin.x, Margin.y, _win.position.width - Margin.x - Margin.z, _win.position.height - Margin.y - Margin.w);
            Begin(rect);
        }
    }
}