The previous recipe demonstrated how to change the mouse pointer for 2D and 3D GameObjects receiving OnMouseEnter and OnMouseExit events. Unity UI controls do not receive OnMouseEnter and OnMouseExit events. Instead, UI controls can be made to respond to PointerEnter and PointerExit events if we add a special Event Trigger component to the UI GameObject. In this recipe, we'll change the mouse pointer to a custom magnifying glass cursor when it moves over a UI Button GameObject:
Setting custom mouse cursors for UI controls
Getting ready
For this recipe, we'll use the same asset files as for the previous recipe, and its CustomCursorPointer C# script class, all of which can be found in the 02_07 folder.
...