HubDoor

Checked with version: 2017.3

-

Difficulty: Beginner

This component is used to change the sprite of an object depending on how many inventory items have been collected.

Once all the items have been collected the On Unlocked function is called. In the below example the three inventory items to collect are Key1, Key2 and Key3. Each time one item in the inventory is collected the sprite will change.

Interact On Trigger 2D and Interact On Button 2D are also able to check if this component has been satisfied.

  • Required Inventory Item Keys: The list of Keys of the objects that need to be collected. Once ALL are collected it will trigger the On Unlocked Event.

    • Size: The amount of items that need to be collected. Size increases the number of Elements below.

    • Element: The Key of the objects collected.

  • Unlock State Sprites: The list of sprites that will display when collecting items. Sprites will change sequentially.

    • Size: Number of sprite slots.

    • Element: A sprite that will change the appearance of an object when an inventory item is collected.

  • Key Director Trigger: This triggers a Director sequence if one is set up.

  • Character Inventory: The object holding the Inventory Controller this component uses to track the collection.

  • On Unlocked (): The events triggered when all the items have been collected and sprites changed.

  • Data Settings: See the Persistent Data documentation for more info.

Related tutorials