IPointerEnterHandler and IPointerExitHandler not working
I'm creating a simple inventory system and both IPointerEnterHandler and IPointerExitHandler are not working in my code they for some reason are both underlined red and unity only gives me
public void OnPointerExit(PointerEventData eventData)
{
throw new System.NotImplementedException();
}
}
as a fix after the rest of my code but my inventory system still does not work Here is the full code for reference if anyone can help
using System.Collections; using System.Collections.Generic; using UnityEngine; using UnityEngine.EventSystems;
public class Slot : MonoBehaviour, IPointerEnterHandler, IPointerExitHandler { public bool used; public bool hovered; private GameObject item; private Texture itemIcon;
void Start()
{
hovered = false;
}
void Update()
{
}
public void OnPointEnter(PointerEventData eventData)
{
hovered = true;
}
public void OnPointExit(PointerEventData eventData)
{
hovered = false;
}
}
Answer by TBH-MITRE · Dec 08, 2021 at 02:48 PM
The method names need to be OnPointerEnter / OnPointerExit. You currently have OnPointEnter / OnPointExit.
Your answer
Follow this Question
Related Questions
Adding a prefab to the Item class instance 0 Answers
Argument out of range? 2 Answers
How to make a Inventory Hotbar 0 Answers
How Can I make items inventory? (HELP) 0 Answers
Help with Interface-free inventory 0 Answers