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

public class PlayerInteractPoint : MonoBehaviour, IPointerClickHandler, IPointerEnterHandler, IPointerExitHandler
{
    public UnityEvent PlayerArrival;
    public UnityEvent InteractInitiated;

    public Material glowMaterial = null;
    private Material originalMaterial = null;

    private MeshRenderer meshRenderer = null;

    // Mousehover FX?

    // Click FX?

    void Start()
    {
        meshRenderer = GetComponent<MeshRenderer>();
        originalMaterial = meshRenderer.material;
    }

    [Tooltip("Where the player should navigate to and what direction to face on arrival")]
    public Transform OperationLocation;


    public void OnPointerClick(PointerEventData pointerEventData)
    {
        InteractInitiated.Invoke();
    }

    public void OnPointerEnter(PointerEventData pointerEventData)
    {
        meshRenderer.material = glowMaterial;

    }

    public void OnPointerExit(PointerEventData pointerEventData)
    {
        meshRenderer.material = originalMaterial;

    }



}
