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 RexState the RexController 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 RexActor 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 RexActor 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.

public EnableType enableType

Can be set to Permanent, UntilDeath, or Unique. If set to UntilDeath, this attack will wear off when the player dies, assuming it was given to the player by a WeaponUpgrade powerup. If set to Unique, earning this attack via a WeaponUpgrade powerup will also remove any other Attacks on the player with the Unique designation.

public AttackDirection attackDirection

Whether the attack extends in front of or behind the actor. Primarily used by WallClingState to allow the actor to attack away from the wall they’re clinging to rather than inside it.