using RothenburgAR.PointOfInterest;
using UnityEngine;
using UnityEngine.Events;

namespace RothenburgAR.UI
{
    class PoiRaycastReceiverBehaviour : MonoBehaviour
    {
        public UnityEvent OnClick;

        public void ActivateCrosshairs()
        {
            InputManager.Instance.ActivateCrosshairs();
        }

        public void PoiClicked()
        {
            PoiBehaviour pb = gameObject.GetComponentInParent<PoiBehaviour>();

            if (pb == null) return;
            Debug.Log("poi " + gameObject.name + " clicked, poi reference: " + pb.ReferencedID);

            if (UIManager.Instance.IsARViewVisible)
            {
                UIManager.Instance.ARViewBehaviour.DisplayPoiDetails(pb);
            }
        }
    }
}
