VirtualKey
A class in Root.Township, the global namespace.
One key on a VirtualKeyboard: shows its character (or shifted one) on a text renderer and sends its key code when pressed.
- Listed in Global namespace: T to X
- Inherits or implements
MonoBehaviour
Constructors
| Member | What it is |
|---|---|
VirtualKey() | Unity makes components itself; use AddComponent or spawn a prefab instead of new. |
Fields
6 private and internal fields
| Member | What it is |
|---|---|
private BoxCollider buttonCollider | The key's collider, scaled up for the space key. |
private VirtualKeyInfo info | Key code and shifted key code for this key. |
private Transform[] scalingTransforms | Transforms scaled to spaceScale for the space key. |
private Vector3 spaceScale | Scale used for the space key. |
private TextRenderer text | Text renderer showing the key's label. |
private VirtualKeyboard virtualKeyboard | The keyboard this key belongs to. |
Methods
| Member | What it is |
|---|---|
void Press() | Sends the key's code (or shift code while shift is held) to the keyboard. |
void Setup(VirtualKeyInfo info, VirtualKeyboard virtualKeyboard) | Stores the key info and keyboard, and updates the label when shift changes. |
3 private and internal methods
Used in
Members of other types that take, return or hold a VirtualKey: