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

public class MovableHolder : MonoBehaviour, IPointerDownHandler, IPointerUpHandler
{
    private IMovable _holdingMovable;

    public void SetHoldingMovable(IMovable movable)
    {
        _holdingMovable = movable;
    }
    public void OnPointerDown(PointerEventData eventData)
    {
        if (_holdingMovable != null)
        {
            App_EventManager.OnMovableMouseDown?.Invoke(_holdingMovable);
        }
    }
    public void OnPointerUp(PointerEventData eventData)
    {
        if (_holdingMovable != null)
        {
            App_EventManager.OnMovableMouseUp?.Invoke(_holdingMovable);
        }
    }
}
