Skip to main content

HandPositionStructure

An abstract class in Root.Township, the global namespace.

Base asset for skill inputs triggered by holding a hand in a set position (such as hand to heart) for a time. Subclasses decide what counts as in position.

Constructors​

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

Fields​

3 private and internal fields
MemberWhat it is
private float activeTimeHow long the skill stays active once triggered (default 2s). 0 means it does not time out.
private HandPositionInputModifier[] modifiersModifiers run in order over the position check result.
private float timeInPositionToActivateHow long the hand must stay in position before the skill activates (default 1s).

Properties​

MemberWhat it is
float ActiveTime { get; }Seconds the input stays active once triggered. 0 means it doesn't time out.
float TimeInPositionToActivate { get; }Seconds the hand must stay in position before the input activates.

Methods​

MemberWhat it is
override ISkillInputMethod GetNewInput()Creates a new HandPositionInput that tracks this structure.
bool IsInPosition(HeldPickupHandler handler)Whether the hand is in position, after the configured modifiers have had their say.
protected abstract bool IsInPositionInternal(HeldPickupHandler handler)Subclass check for the raw hand position, before modifiers.

Used in​

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