UnityScripterAI
Discord ↗
Link Copied to Clipboard
×
"mouse over and exit color in the game"
public class OnMouseOverColor : MonoBehaviour, IPointerEnterHandler, IPointerExitHandler, IEventSystemHandler { public Color DefaultColor; public Color HoverColor; public void OnPointerEnter(PointerEventData eventData) { GetComponent<Image>().color = HoverColor; } public void OnPointerExit(PointerEventData eventData) { GetComponent<Image>().color = DefaultColor; } }