The Action System is responsible for handling the activation, deactivation, and cancellation of actions based on predefined rules and combos. It serves as a central hub for handling various aspects related to player actions and interactions.
The ActionComponent
is a Unity component designed to manage the activation, deactivation, and cancellation of actions based on rules and combos. It serves as a central hub for handling various aspects of player actions and interactions. This component plays a crucial role in orchestrating the timing and sequence of in-game events related to combat gameplay.
ActionID
is a scriptable object the ActionComponent
uses to uniquely identify different actions in the game. It acts as a lightweight identifier, allowing for a clean and organized way to represent various actions without data. It distinguishes between various actions and plays a crucial role in referencing and managing actions throughout the gameplay.
ActionRule
is a key concept within the ActionComponent
that defines relationships between different actions. It determines which action blocks or cancels others, providing a flexible way to handle complex interaction scenarios.
Whenever the component attempts to activate an action, it will check the rules against said action. If it is blocked, the action refuses to activate.
If it cancels any of the active actions, those are canceled before said action is activated.
Actions block themselves by default.
Actions blocked by at least one rule are blocked.
<aside> ❕ Conflict of rules can happen when Action1 is blocking Action2, but Action2 is also canceling Action1. In case of conflicting rules, the last rule in the list takes precedence.
</aside>
It contains a list of ActionID
instances for the purposes of setting up a hierarchy of actions. An ActionGroup
can contain another ActionGroup
.
<aside>
⚠️ Note that the ActionGroup
has no runtime significance. It only exists to simplify the rules setup. Any rule containing an ActionGroup
will automatically expand into rules with ActionID
. For example:
1 Rule ⇒ [ Attack1, Attack2 ] Blocks [ Move, Jump ]
will internally be convert into:
4 Rule ⇒ { Attack1 Blocks Move }, { Attack2 Blocks Move }, { Attack1 Blocks Jump }, { Attack2 Blocks Jump }
Note that ALL actions from every level of the action hierarchy are collected and the rule applies to all of them.
</aside>