C# Class UnityPlatformer.CharacterActionTimed

Manage actions that has the loop: cast -> duration -> cooldown . Timeline explanation:\n 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\n action has a durationTime. During castTime to castTime + durationTime we deal damage\n We have to wail from 0 to cooldownTime to cast again
Inheritance: CharacterAction
Show file Open project: llafuente/unity-platformer

Public Properties

Property Type Description
onInterrupt System.Action

Protected Properties

Property Type Description
actionCounter int
castFrames int
cooldownCounter int
cooldownFrames int
durationFrames int

Public Methods

Method Description
EndAction ( ) : void

End action!

Interrupt ( bool resetCooldown ) : void

interrupt current action

IsActionComplete ( ) : bool

attack ended

IsActionInProgress ( ) : bool

Attacking time

IsCasting ( ) : bool

Casting time

IsCooldown ( ) : bool

Can perform action?

OnEnable ( ) : void

conver time to frames

StartAction ( ) : void

Start action!

WantsToUpdate ( float delta ) : int

Method Details

EndAction() public method

End action!
public EndAction ( ) : void
return void

Interrupt() public method

interrupt current action
public Interrupt ( bool resetCooldown ) : void
resetCooldown bool Reset cooldown. Allow to cast again!
return void

IsActionComplete() public method

attack ended
public IsActionComplete ( ) : bool
return bool

IsActionInProgress() public method

Attacking time
public IsActionInProgress ( ) : bool
return bool

IsCasting() public method

Casting time
public IsCasting ( ) : bool
return bool

IsCooldown() public method

Can perform action?
public IsCooldown ( ) : bool
return bool

OnEnable() public method

conver time to frames
public OnEnable ( ) : void
return void

StartAction() public method

Start action!
public StartAction ( ) : void
return void

WantsToUpdate() public method

public WantsToUpdate ( float delta ) : int
delta float
return int

Property Details

actionCounter protected property

count frames the action is running
protected int actionCounter
return int

castFrames protected property

castTime in frames
protected int castFrames
return int

cooldownCounter protected property

counter for cooldown
protected int cooldownCounter
return int

cooldownFrames protected property

cooldownTime in frames
protected int cooldownFrames
return int

durationFrames protected property

durationTime in frames
protected int durationFrames
return int

onInterrupt public property

Notify action is interrupted NOTE It's not used in the library right now, but you can
public Action,System onInterrupt
return System.Action