SmartKey
SmartKey is a Unity component that encapsulates the concept of a “key” in the game environment. It defines an object that holds the ability to unlock or interact with one or more SmartDoor objects.
Last updated
Was this helpful?
SmartKey is a Unity component that encapsulates the concept of a “key” in the game environment. It defines an object that holds the ability to unlock or interact with one or more SmartDoor objects.
Last updated
Was this helpful?
Each instance of SmartKey
can be uniquely identified or described through the keyName
property. This could be used for various purposes like showcasing the name of the key to the player, or to determine game-rules based on the different keys.
Each SmartKey
object maintains a list of SmartDoor
objects that it can unlock. This is maintained in the unlockDoors
property. Assign SmartDoor
objects to this array to establish doors that the key can interact with.
Attach the SmartKey
component to any GameObject, ideally this would be a GameObject that visually represents a key in the game. The key can then be configured to dictate which SmartDoor
objects it can interact with, through the unlockDoors
property. This level of control in the hands of the developer allows for varied game mechanics and puzzles by determining the interaction between specific keys and doors.
This is a string property where you can define the name of the key. This name might be used for display in a UI, or for debugging and identification purposes within the Unity Editor.
This is an array of SmartDoor objects that represents specific doors this key can unlock or operate. By setting up different keys to interact with different sets of doors, you can manage access and player progression in your game.