Attack

Attack gives you access to both melee and projectile attacks. It lets you slot animations for both the attack itself and the actor performing the attack.

Public Methods

public void ForceBegin()

Forces the attack to begin immediately. Often unsafe to call, since it bypasses the traditional checks Attack will make when determining if the attack can currently be executed.

public void Begin()

Checks to see if the attack can currently be executed, and then initiates it if so. This is the traditional and safe way to initiate an attack.

public void Cancel()

Immediately stops the attack if it’s in-progress.

public bool CanInitiate()

Returns true if the attack can currently be initiated.

public bool CanInterrupt(ActionType _actionType)

Returns whether or not this attack can be interrupted by another action. The type of action it checks against is passed in via the _actionType argument.

public void CreateProjectile()

If the attack has a Projectile slotted under its ProjectileProperties, this spawns it.

public AnimationClip GetActorAnimationClip()

Uses the actor and its controller to determine the JetState the JetController is in, and returns the AnimationClip that should play when the Attack is executed in that state.

Public Members

public Slots slots

A series of slots to hold base-level things such as the JetActor and the SpriteRenderer utilized by this attack.

public ProjectileProperties projectile

The Projectile spawned when this attack is initiated and its related properties. This can be left blank if no projectile is desired.

public AttackAnimations actorAnimations

A series of AnimationClips for how the actor initiating this attack will look while performing the attack in different states.

public AttackAnimations attackAnimations

A series of AnimationClips for how this attack will look while the JetActor initiating it is in different states.

public AudioClip audioClip

The AudioClip, if any, which plays when this attack begins.

public ActionsAllowedDuringAttack actionsAllowedDuringAttack

A series of bools indicating what additional actions, such as jumping or running, are allowed while this attack is in progress.

public CanceledBy canceledBy

A series of bools determining which actions this attack can be canceled by.

public Cancels cancels

A series of bools which determine what actions will be canceled by this attack beginning.

public CanInitiateFrom canInitiateFrom

A series of bools which determine what states this attack can be initiated from.

public AttackImportance attackInputImportance

If an Input is attached, this governs whether the attack is called on the Attack or the SubAttack button.

public int cooldownFrames

Frames between the ability to repeat this attack. If this is 0, you can repeat it immediately.

public bool isEnabled

Whether or not the attack can be used.

public bool willAutoEnableCollider

If False, you need to manually enable the collider for this attack when it is executed. If True, the collider will enable itself as soon as the attack begins.

public int currentCooldownFrame

The current frame between cooldowns.

public bool willSyncMoveAnimation

If True, the AnimationClip that plays while the actor is attacking in MovingState will attempt to sync its start time to where the actor was in its MovingState animation. This can be used to sync the walk cycles of the animations.

public float crouchOffset

The vertical offset of the attack when the actor is crouching.