As well as being able to show icons that tell us whether we have certain keys or not, we can also use the Hub Door component to generate a similar feature in the game, but applied differently:
The Hub Door component is designed to change the visual state of a sprite depending on which and how many items we have in our inventory. Let's take the Zone2 example:
The first time we get to the zone, the door state is completely inactive, as we can see in the previous screenshot. After we pick up the key, the visual will change:
The steps are repeated for the second key:
And finally, we pick up the last key, which unlocks the door and triggers a dialog canvas:
As mentioned previously, the script in charge of doing this is the Hub Door component. In order to know how to use it, we first need to know its properties:
Required Inventory... |