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 theEntity
that acts as the controller for the unlocking logic. SeeICurrency
as an example implementation ofIUnlockable
. -
IUnlockableSavedData
- This interface is attached to the Entity'sISavedData
that allows serialization of the states of theIUnlockable
. SeeICurrencySavedData
as 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.