Skip to main content

FunctionKeyDefinition

A class in Root.Township, the global namespace.

Inspector entry that binds a keyboard key to a UnityEvent, with an optional on-screen key visual.

Constructors​

MemberWhat it is
FunctionKeyDefinition()Creates a FunctionKeyDefinition with default values.

Fields​

MemberWhat it is
bool hasVisualWhether a key visual is shown; the text and transform fields only apply when on.
KeyCode keyThe key that triggers onPressed.
GameObject keyImageObject used as the key's visual.
UnityEvent onPressedEvent invoked when the key is pressed.
Vector3 positionPosition of the key visual.
Quaternion rotationRotation of the key visual.
Vector3 scaleScale of the key visual.
string textLabel shown on the key visual.

Used in​

Members of other types that take, return or hold a FunctionKeyDefinition: