O'Reilly logo

Unity UI Cookbook by Francesco Sapio

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Changing the cursor at runtime

The cursor is another important UI element that is not directly controlled by UI classes. This is the case since they are new in Unity, while the cursor was already implemented earlier. However, changing the cursor at runtime could be very useful for the player to distinguish different actions, and it can also be graphically nicer. For instance, in a Real-Time Strategy (RTS) game, the cursor can change when the player decides to move units or orders them to attack enemies.

At this stage, you are also ready to learn other techniques to deal with UI events, directly inside your scripts, instead of setting them through the Inspector, maybe also using the Event Trigger component. In fact, here you will learn how to use ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required