Jump to content
Aveyond Studios Community
Ant

Create or edit a UI hero listener

Recommended Posts

What is a UI hero listener?

A UI hero listener lets an object in a UI communicate with a hero block. A UI object is an object that exists inside a UI Canvas (for example, a button).

Create a UI hero listener:

Spoiler

Open the scene you want to work with. In the Hierarchy Tab, click on the game object that represents an object in a UI (button, label, etc). In the Inspector, click Add Component. In the search box, enter Hero Kit Listener UI. In the results list, select Hero Kit Listener UI.

CXou1I5.gif

Play an event on a hero object when player interacts with listener:

Spoiler

Select the game object that contains the listener in the Hierarchy Tab. In the inspector tab, scroll down to the component called Hero Kit Listener. In the Input Type field, select the input event which must occur to send a notification to a hero block. In the Send notifications field, select the hero block in the scene that will interact with this listener. Select the state and then the event that should run. 

In this example, we watch for the player to click a button in the UI. If the player clicks the button when the game is running, an event called Use Potion is run on a Hero Block called Player.

8KFhGrY.gif

 

Share this post


Link to post
Share on other sites

×