# SmartKey

### Core Features <a href="#core-features" id="core-features"></a>

#### Key Identification <a href="#key-identification" id="key-identification"></a>

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.

#### Door Unlock Mapping <a href="#door-unlock-mapping" id="door-unlock-mapping"></a>

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.

### Usage <a href="#usage" id="usage"></a>

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.

![Smart Key Component](https://charley3d.github.io/doorsystem/images/smarkeyComponent.png)

#### Key Name <a href="#key-name" id="key-name"></a>

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.

#### Unlock doors <a href="#unlock-doors" id="unlock-doors"></a>

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.


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://docs.cgpoly.io/door-system-documentation/advanced/components/smartkey.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
