Code Examples

v1.0

Cancelling an ActionExecutor

Canceling Cancelling

Can Execute?

The CanExecute property will return true if the ActionExecutor can execute β€” this looks into both restart functionality as well as whether the executor is actively in a cooldown period.

In the example below, we utilize the cooldown period as a proxy for whether the enemy can actually attack, to ensure that all Actions have completed before we start fresh.

// RPGGameManager.cs from Game Modules 4 Integration Demo
public bool EnemyCanAttack => enemy.attackActions.ActionExecutor.CanExecute;

Other Properties

In most cases we don't expect you'll need these, but they are available.

public bool IsExecuting
public bool HasActions
public List<ExecutableItem> ExecutableItems // These can be Actions or Groups!
public ExecutableItem GetExecutableItem(string uid)
public Component Target

Updating Setting at Runtime

While less common, you can update settings on ActionExecutor objects at runtime.

Obtaining Cooldown Time

ActionExecutor objects have a float CooldownTime, but the CooldownTimeType determines what the actual time is at runtime. You can check the actual cooldown time using the EffectiveCooldownTime property, which will provide the actual time for a cooldown in seconds.

Last updated