There are demo scenes included in the package with information on the purpose of each scene, interactions, and any specific features demonstrated.
The first demo scene features a single playable character with basic actions, including movement, attack combos, dodge, and dodge attack. The character's actions are controlled through a well-organized set of components.
Input GameObject:
Inputs are redirected through this with Unity Events.
Movement GameObject:
Dodge GameObject:
Attack GameObject:
Jump GameObject:
Timelines GameObject:
Camera:
The camera has components unrelated to the package. It follows the player.
Actions Used:
Movement
For movement, the first signal comes from the Input Gameobject. On any movement, the vector for it will be passed to the MovementActionController
. From there the component will request a move action. If it is activated, it will pass the vector the the ForwardMoveController
. It will move the character using the MovementController
to rotate and move the character forward-faced based on the camera. There is no timeline for this action. MovementActionController
sets the parameter of an animator based on the movement vector received using the OnMove and OnIdle events.
Fast Attack 1 and 2
The Fast Attacks are parts of a combo. First, the Input will send a signal to the Attack gameobject. The SwordAttackController
will try to continue any of the combos. If none of them were continued then the first combo is started by activating its first action. The fast attack combo contains two actions.
The timelines are set up with the ActionTimelinePlayerComponent
. The source scriptable object maps the two attack actions to two timelines. Once those actions are activated the component will automatically play the timeline with the given wrap mode on the director given to the component.
The timelines for these actions are these.
Attack Fast 1 Timeline:
This timeline has six timelines.
Attack Fast 2 Timeline:
Roll
The rolling is part of a combo but the initial action of the rolling itself is activated through the usual means. The Input, at first, sends a signal to the Dodge gameobject. The DodgeAttackComponent
will take the vector, and request activation of the action. If activated will set the vector as the “Direction” of the dodge and the current position of the character as “Initial Position”.
The timeline set up for the dodge with the ActionTimelinePlayerComponent
will be played on activation.
The timeline for the Dodge action is shown below.
Dodge Timeline:
IHealthComponent
**on it, assigned to the track.Roll Strike
Roll strike is a combo. The first action of this combo is the dodge action which is explained above. The second action which is the strict is activated through the attack component which is also mentioned above. The combo for the Roll Strike is shown below.
As mentioned before, in the Dodge Timeline, there is a window to allow the continuation of the combo. And the SwordAttackController
will activate the dodge strike action. The timeline for the roll-strike will be played by ActionTimelinePlayerComponent
as shown below.
Jump and Double Jump
The jumps are parts of a combo. Starting with the input to the JumpComponent
, it will attempt to start(First Jump) or continue(Second Jump) of the jump combo.
There is a special FallComponent
whose function is unique compared to the other components. It checks if the character is grounded. If it is, it will request an action activation for falling. Once the action is active it will proceed to drop the character, moving it downward, using physics.
Many aspects of this scene are similar to the Demo Scene 1. Those that are different are described below.
Targeting and Movement
The Movement gameobject has new components:
Strafe Move Controller:
It uses the TargetProvider
and the main camera to make a strafing movement for the character.
Targeted Move Controller:
If TargetProvider
has a target, it will use the StrafeMoveController
, otherwise uses ForwardMoveController
.
The events from the input are redirected to the TargetedMoveController
as well.
The Targeting gameobject handles managing a target. A target can be anything.
Target Finder:
It will search the vicinity in radius to find any non-trigger collider the matches the “Layer Mask”.
Target Provider:
It holds the target and a MovementController
references.
Player Health Elements
Health Component:
Manages the health related values and events. It implements the IHealthComopnent
that handles invulnerability for the timeline.
Damage Dealer Component:
A necessary component for dealing damage. See Damaging for more details.
Death Components:
Simply activates a Death action. In the ruleset, a death action can block ALL other actions.
Self Heal
Self Heal Component:
It tries to activate a “Self Heal” action. Notice that there is a Timeline Signal invoked to do the healing. What happens here is that the SelfHealComponent
activates the action and does nothing else. The timeline that associates with the action is played. Once the signal is triggered the function on the SelfHealComponent
that does the actual healing is called.