Skip to content

IUnlockable

IUnlockable

IUnlockable marks an entity that can be enabled or disabled during certain in-game functions.

Tip

For example, we can prevent the player from having a specific Currency in a RandomObtainedCurrencyReward until a later IStage for balance purposes, or we can forcefully give the player a specific Currency in a tutorial even though it has never been seen by the player.

Components

obtain_available_relation

  • IUnlockable - This interface is attached to the Entity that acts as the controller for the unlocking logic. See ICurrency as an example implementation of IUnlockable.

  • IUnlockableSavedData - This interface is attached to the Entity's ISavedData that allows serialization of the states of the IUnlockable. See ICurrencySavedData as an example implementation of IUnlockableSavedData.

States

Available and Obtained are two crucial variables used to describe the state of an IUnlockable and to determine how it is presented to the player based on its implementation. A designer can manipulate these properties to create unique gameplay with the IUnlockable.

Available

If the available flag on the IUnlockable is set to true, it means that the Entity can be granted to the player (such as via a RandomUnObtainedCurrencyReward).

Obtained

If the obtained flag on the IUnlockable is set to true, it means that the Entity has already been granted to the player in the past (such as via a RandomObtainedCurrencyReward).

Available vs Obtained

For more example use-cases, please visit the available vs obtained page.