using UnityEditor;
using UnityEngine;
using System.Collections;

[CustomEditor(typeof(Anchor))]
public class AnchorEditor : Editor
{
    public override void OnInspectorGUI()
    {
        base.OnInspectorGUI();
        if (GUILayout.Button("Apply"))
        {            
            Anchor anchorScript = (Anchor)target;
            anchorScript.ApplyAnchors(anchorScript.transform.root.position);
            Debug.Log("Anchor applied on gameobject '" + anchorScript.gameObject.name + "'");
            Debug.Log("You are using LayerManager in EditorMode. Remember to set your Game resolution to " + LayerManager.ScreenWidth + "x" + LayerManager.ScreenHeight + " for functionalities to work properly.");
            LayerManager.KillWhenInEditor();
        }
    }
}