Skip to main content

GestureMap

A class in Root.Township, the global namespace.

Asset that maps D-pad directions to hand gestures, plus the idle gesture. Used by HandGestureController.

Constructors​

MemberWhat it is
GestureMap()Use ScriptableObject.CreateInstance instead of new; Unity loads the saved ones from assets.

Fields​

4 private and internal fields
MemberWhat it is
private Dictionary<int, HandGestureDefinition> gestureMapCached lookup behind Map.
private GestureMap.GestureMapping[] gestureMappingsSerialized direction and gesture pairs. Directions must not exceed the D-pad's button count.
private HandGestureDefinition idleGestureBacking field for IdleGesture.
private bool isGradualGripBacking field for IsGradualGrip.

Properties​

MemberWhat it is
HandGestureDefinition IdleGesture { get; }The gesture used when no direction is chosen.
bool IsGradualGrip { get; }When true, the hand animator's grab value follows the grip axis on clients.
Dictionary<int, HandGestureDefinition> Map { get; }D-pad direction to gesture lookup, built on first use.

Methods​

MemberWhat it is
void SetupDictionary()Builds the direction to gesture lookup from the serialized mappings. Throws on duplicate directions.

Used in​

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