using System.Collections;
using System.Collections.Generic;
using UnityEngine;
using UnityEngine.EventSystems;

public class UnitTreeDisplay : MonoBehaviour, IPointerEnterHandler, IPointerExitHandler
{
    //private Vector3 _originPosition;
    private Vector2 _size;
    private RectTransform _rectTransform;


    // Start is called before the first frame update
    void Start()
    {
        Debug.Log("Rect formed");
        _rectTransform = GetComponent<RectTransform>();
        _size = _rectTransform.sizeDelta;
        _rectTransform.anchoredPosition = transform.position;
    }

    public void SetPosition(Vector3 position)
    {
        _rectTransform.anchoredPosition = position;
    }

    public void OnPointerEnter(PointerEventData eventData)
    {
        _rectTransform.sizeDelta = _size * 1.05f;
    }

    public void OnPointerExit(PointerEventData eventData)
    {
        _rectTransform.sizeDelta = _size;
    }
}
