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

-
IUnlockable- This interface is attached to theEntitythat acts as the controller for the unlocking logic. SeeICurrencyas an example implementation ofIUnlockable. -
IUnlockableSavedData- This interface is attached to the Entity'sISavedDatathat allows serialization of the states of theIUnlockable. SeeICurrencySavedDataas an example implementation ofIUnlockableSavedData.
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.