using UnityEngine;
using UnityEditor;
using System;

namespace mgaia.Utils
{
    /// <summary>
    /// Editor do behaviour de window transform
    /// </summary>
    /// <owner>Victor</owner>
    [CustomEditor(typeof(AnchoredPositioningBehaviour))]
    public class AnchoredPositioningBehaviourCustomEditor : UnityEditor.Editor
    {
        /// <summary>
        /// Desenha o editor customizado
        /// </summary>
        public override void OnInspectorGUI()
        {
            DrawDefaultInspector();

            if (GUILayout.Button("Force update anchor"))
            {
                AnchoredPositioningBehaviour anchoredPositioningBehaviour = (AnchoredPositioningBehaviour)target;
                anchoredPositioningBehaviour.Commit();
            }
        }
    }
}