using UnityEditor;
using UnityEngine;


[CustomEditor(typeof(CameraMovement))]
[CanEditMultipleObjects]
public class CameraMovementEditor : Editor
{
    public void OnSceneGUI()
    {
        var t = (target as CameraMovement);

        EditorGUI.BeginChangeCheck();
        Vector3 posLeft = Handles.PositionHandle(t.bottomLeftPoint, Quaternion.identity);
        Vector3 posRight = Handles.PositionHandle(t.topRightPoint, Quaternion.identity);


        if (EditorGUI.EndChangeCheck())
        {
            Undo.RecordObject(target, "Move point");
            t.bottomLeftPoint = posLeft;
            t.topRightPoint = posRight;
        }
    }
}
