Create a system which allows game designers to create various keys for a game without changing the code.
This system consists of:
A simple component which allows to store and control acquired keys.
The component should have these parameters, functions, and callbacks.
FUNCTION | DESCRIPTION |
---|---|
AddKey |
Adds a given KeyType to an array of acquired keys if it’s not acquired |
RemoveKey |
Removes a given KeyType from an array of acquired keys if it’s acquired |
HasKey |
Check if a given KeyType is in the array of acquired keys |
UseKey |
Uses a given KeyType if it’s in the array of acquired keys |
CALLBACK | DESCRIPTION |
---|---|
OnKeyAdded |
Called when a new key was added |
OnKeyRemoved |
Called when a key was removed |
OnKeyUsed |
Called when a key is used |
A component which controls the lock state of an owner.
The component should have these parameters, functions, and callbacks.
PARAMETER | DESCRIPTION |
---|---|
IsLocked |
Determines the initial state of the component |
RequiredKey |
Determines KeyType required to change a component state |
FUNCTION | DESCRIPTION |
---|---|
Lock |
Changes a component state to Locked |
Unlock |
Changes a component state to Unlocked |
CALLBACK | DESCRIPTION |
---|---|
OnLocked |
Called when a component state is changed to Locked |
OnUnlocked |
Called when a component state is changed to Unlocked |
A light-weight object which