Skip to main content

DownwardSwingInput

A class in Root.Township, the global namespace.

Skill input that turns on after the player raises the held tool above their head and then brings it down quickly. Made by DownwardSwingInputStructure.

Constructors​

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

Fields​

3 private and internal fields
MemberWhat it is
private float lastTimeUpReal time when the hands were last above the head, or when the input activated.
private DownwardSwingInputStructure structureSettings asset with the heights and timings.
private bool wasChargedWhether the hands have been raised since the last swing.

Properties​

MemberWhat it is
HeldPickupHandler Handler { get; private set; }The held pickup handler this input watches.
bool IsActive { get; private set; }True after a completed downward swing, until the active time runs out or it is reset.
2 private and internal properties
MemberWhat it is
private bool ISkillInputMethod.NeedsUpdate { get; }Always true, so Update runs every frame.
private bool ISkillInputMethod.ReceivesHits { get; }Always false; this input ignores hits.

Events​

MemberWhat it is
event Action<bool, ISkillInputMethod> ChangedActiveRaised when the input turns on or off.

Methods​

MemberWhat it is
void Reset(bool isCallingEvent)Clears the charge and turns the input off, optionally raising ChangedActive.
4 private and internal methods
MemberWhat it is
private void ISkillInputMethod.Clear()Resets the input and raises ChangedActive if it was active.
private bool ISkillInputMethod.ReceiveHit(HeldPickupHandler handler, ImpactHitWithTool hitWithTool, ProfessionSkill skill)Does nothing and returns false.
private void ISkillInputMethod.RegisterHandler(HeldPickupHandler pickupHandler, SkillInputStructure structure, ProfessionSkill skill)Stores the handler and the DownwardSwingInputStructure settings.
private void ISkillInputMethod.Update()Compares the average hand height to the head: above HeightUp charges, then below HeightDown within TimeToLowerHand activates.