The timeline part of the package introduces a series of tracks and interfaces for orchestrating the temporal aspects of actions. Various timeline tracks, such as Animation, Damage Zone, etc., handle specific facets of actions. All those tracks communicate with Interfaces that define the common functionality for these timelines. These tracks facilitate precise timing within the Unity Timeline, enhancing the overall control and coordination of events in gameplay. While initially designed for combat-oriented games, the tracks are versatile and applicable to various game types.
<aside> đź’ˇ Since most tracks communicate with interfaces, developers have the flexibility to create their implementations based on their specific use cases. However, those interfaces must be implemented within a component. Basic and example implementations are provided and explained in the later in the documentation.
</aside>
ActionTimelinePairPlayer
is a component that watches an ActionComponent
for any action activation. When an action is activated, it will try to find an associated timeline and play it on the given PlayableDirector
. You can have multiple ActionTimelinePairPlayer
dealing with multiple ActionComponent
instances.
The Action Track is a custom track designed to interact with the ActionComponent
during a timeline.
Clip Types:
Action Rule Clip:
Adds new rules to the ActionComponent
when activated and removes them when deactivated.
Allow Action Combo Clip:
Grants permission to the ActionComponent
to continue an ActionCombo
and removes said permission when the clip is over.
The Animator Track is a custom track facilitating the setting and resetting of parameters for an animator.
Clip Types:
These clips affect an animator parameter. As long as the clip is played, the value is applied to the parameter. When the clip is finished, the value is reset.
Animator Param Bool Clip
Animator Param Float Clip
Animator Param Int Clip
Animator Param Trigger Clip
Trigger is different is it only needs to activate once. Once the trigger is registered and used in the animator, it will reset. But if it is registered and not used by the end of the clip, the clip itself will reset the trigger.
Animator Layer Clip
It will set the animator’s layer weight and reset it once the clip is finished.
The Damage Zone Tracks coupled with the IDamageDealerComponent
interface, check for enemies within defined zones. If an enemy is detected, damage is dealt to the receiver. The receiver must implement the IDamageReceiverComponent
interface. These tracks provide a visual representation with gizmo previews.
Clip Types:
<aside> ❕ A damage zone clip keeps a memory of the targets it has damaged to prevent from damaging them again in the clip’s duration.
</aside>
Cube Damage Zone Clip:
It will cast a cube local to the “Source Transform” with an offset from ”center” rotated by ”rotation” and scaled with “halfSize” relative to “pivot” and deal damage to any targets inside the cube.
Sphere Damage Zone Clip:
It will cast a sphere local to the “Source Transform” with an offset from ”center” with the “radius” size and deal damage to any targets inside the sphere.