platformer
|
Manage actions that has the loop: cast -> duration -> cooldown . More...
Public Member Functions | |
override void | OnEnable () |
Create Delays More... | |
override void | OnDisable () |
Dispose Delays More... | |
override void | GainControl (float delta) |
Start action! More... | |
void | Interrupt (bool resetCooldown) |
interrupt current action More... | |
bool | IsCasting () |
in castTime? More... | |
bool | IsActionInProgress () |
after castTime, in durationTime? More... | |
bool | IsDone () |
attack ended More... | |
bool | IsCooldown () |
Can perform action? More... | |
override int | WantsToUpdate (float delta) |
Tells the character we want to take control More... | |
![]() | |
void | Reset () |
Try to set character & input from parent nodes More... | |
virtual void | LoseControl (float delta) |
Called (once) when other action 'WantsToUpdate' or this action don't anymore More... | |
abstract void | PerformAction (float delta) |
Do your action here. More... | |
abstract PostUpdateActions | GetPostUpdateActions () |
Return what to do next. More... | |
Public Attributes | |
float | castTime = 0 |
Casting time More... | |
float | durationTime = 1.0f |
Action duration More... | |
float | cooldownTime = 3.0f |
Action/Animation duration More... | |
Action | onInterrupt |
Notify action is interrupted More... | |
![]() | |
Character | character |
Target character that will be affected by this movement More... | |
PlatformerInput | input |
Input to listen More... | |
Action | onGrainControl |
Callback when this movement WantsToUpdate and has highest priority. More... | |
Action | onLoseControl |
Callback when this movement don't WantsToUpdate or another movement has higher priority More... | |
Protected Attributes | |
Delay | casting |
castTime in frames More... | |
Delay | inprogress |
durationTime in frames More... | |
Delay | cooldown |
cooldownTime in frames More... | |
CharacterActionTimedState | state = CharacterActionTimedState.Ready |
Current action state More... | |
Manage actions that has the loop: cast -> duration -> cooldown .
Timeline explanation:
Character hit the cast action: time = 0 (Play animation if we start casting) action has a castTime. During 0 to castTime we don't deal damage
action has a durationTime. During castTime to castTime + durationTime we deal damage
We have to wail from 0 to cooldownTime to cast again
|
inlinevirtual |
Start action!
Reimplemented from UnityPlatformer.CharacterAction.
|
inline |
interrupt current action
resetCooldown | Reset cooldown. Allow to cast again! |
|
inline |
after castTime, in durationTime?
|
inline |
in castTime?
|
inline |
Can perform action?
|
inline |
attack ended
|
inlinevirtual |
Dispose Delays
Reimplemented from UnityPlatformer.CharacterAction.
|
inlinevirtual |
Create Delays
Reimplemented from UnityPlatformer.CharacterAction.
|
inlinevirtual |
Tells the character we want to take control
Implements UnityPlatformer.CharacterAction.
|
protected |
castTime in frames
float UnityPlatformer.CharacterActionTimed.castTime = 0 |
Casting time
Time the character is waving their hands doing no Damage :)
Time before enable the first damage area
|
protected |
cooldownTime in frames
float UnityPlatformer.CharacterActionTimed.cooldownTime = 3.0f |
Action/Animation duration
Time after durationTime
float UnityPlatformer.CharacterActionTimed.durationTime = 1.0f |
Action duration
Duration of the sparks flying around killing people!
Time after castTime
|
protected |
durationTime in frames
Action UnityPlatformer.CharacterActionTimed.onInterrupt |
Notify action is interrupted
NOTE It's not used in the library right now, but you can
|
protected |
Current action state