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.
- Listed in Global namespace: C to D
- Inherits or implements
ISkillInputMethod
Constructors
| Member | What it is |
|---|---|
DownwardSwingInput() | Creates a DownwardSwingInput with default values. |
Fields
3 private and internal fields
| Member | What it is |
|---|---|
private float lastTimeUp | Real time when the hands were last above the head, or when the input activated. |
private DownwardSwingInputStructure structure | Settings asset with the heights and timings. |
private bool wasCharged | Whether the hands have been raised since the last swing. |
Properties
| Member | What 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
Events
| Member | What it is |
|---|---|
event Action<bool, ISkillInputMethod> ChangedActive | Raised when the input turns on or off. |
Methods
| Member | What it is |
|---|---|
void Reset(bool isCallingEvent) | Clears the charge and turns the input off, optionally raising ChangedActive. |
4 private and internal methods
| Member | What 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. |