platformer
Classes | Public Member Functions | Public Attributes | Protected Attributes | List of all members
UnityPlatformer.CharacterActionMelee Class Reference

Melee attack More...

Inheritance diagram for UnityPlatformer.CharacterActionMelee:
UnityPlatformer.CharacterActionTimed UnityPlatformer.CharacterAction

Classes

class  MeleeDamage
 Melee Damage data More...
 

Public Member Functions

override void OnEnable ()
 Setup damageAreas and listen input More...
 
override void OnDisable ()
 remove input listeners More...
 
void OnActionDown (string _action)
 input.onActionDown callabck More...
 
void OnActionUp (string _action)
 input.onActionUp callabck More...
 
void Clear ()
 Disable all areas More...
 
override void GainControl (float delta)
 EnterState More...
 
override void LoseControl (float delta)
 ExitState More...
 
override int WantsToUpdate (float delta)
 attackHeld & and previous attack ended More...
 
override void PerformAction (float delta)
 Do your action here. More...
 
override PostUpdateActions GetPostUpdateActions ()
 Return what to do next. More...
 
- Public Member Functions inherited from UnityPlatformer.CharacterActionTimed
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...
 
- Public Member Functions inherited from UnityPlatformer.CharacterAction
void Reset ()
 Try to set character & input from parent nodes More...
 

Public Attributes

string forceAnimation = ""
 Set forceAnimation at character if not empty More...
 
MeleeDamage [] damageAreas = new MeleeDamage[1]
 List of Damage areas, something like moving hitboxes More...
 
string action = "Attack"
 Input action name More...
 
CharacterStatesCheck characterState
 Combo to check character state More...
 
int priority = 20
 Action priority More...
 
- Public Attributes inherited from UnityPlatformer.CharacterActionTimed
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...
 
- Public Attributes inherited from UnityPlatformer.CharacterAction
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

bool attackHeld = false
 listen action input events More...
 
float startTime = 0.0f
 When attack started More...
 
- Protected Attributes inherited from UnityPlatformer.CharacterActionTimed
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...
 

Detailed Description

Melee attack

NOTE Can't be interrupted atm

Member Function Documentation

◆ Clear()

void UnityPlatformer.CharacterActionMelee.Clear ( )
inline

Disable all areas

◆ GainControl()

override void UnityPlatformer.CharacterActionMelee.GainControl ( float  delta)
inlinevirtual

EnterState

Reimplemented from UnityPlatformer.CharacterAction.

◆ GetPostUpdateActions()

override PostUpdateActions UnityPlatformer.CharacterActionMelee.GetPostUpdateActions ( )
inlinevirtual

Return what to do next.

By default should be: APPLY_GRAVITY | WORLD_COLLISIONS

Implements UnityPlatformer.CharacterAction.

◆ LoseControl()

override void UnityPlatformer.CharacterActionMelee.LoseControl ( float  delta)
inlinevirtual

ExitState

Reimplemented from UnityPlatformer.CharacterAction.

◆ OnActionDown()

void UnityPlatformer.CharacterActionMelee.OnActionDown ( string  _action)
inline

input.onActionDown callabck

◆ OnActionUp()

void UnityPlatformer.CharacterActionMelee.OnActionUp ( string  _action)
inline

input.onActionUp callabck

◆ OnDisable()

override void UnityPlatformer.CharacterActionMelee.OnDisable ( )
inlinevirtual

remove input listeners

Reimplemented from UnityPlatformer.CharacterAction.

◆ OnEnable()

override void UnityPlatformer.CharacterActionMelee.OnEnable ( )
inlinevirtual

Setup damageAreas and listen input

Reimplemented from UnityPlatformer.CharacterAction.

◆ PerformAction()

override void UnityPlatformer.CharacterActionMelee.PerformAction ( float  delta)
inlinevirtual

Do your action here.

Implements UnityPlatformer.CharacterAction.

◆ WantsToUpdate()

override int UnityPlatformer.CharacterActionMelee.WantsToUpdate ( float  delta)
inlinevirtual

attackHeld & and previous attack ended

TODO REVIEW continous attack ?

Implements UnityPlatformer.CharacterAction.

Member Data Documentation

◆ action

string UnityPlatformer.CharacterActionMelee.action = "Attack"

Input action name

◆ attackHeld

bool UnityPlatformer.CharacterActionMelee.attackHeld = false
protected

listen action input events

◆ characterState

CharacterStatesCheck UnityPlatformer.CharacterActionMelee.characterState

Combo to check character state

◆ damageAreas

MeleeDamage [] UnityPlatformer.CharacterActionMelee.damageAreas = new MeleeDamage[1]

List of Damage areas, something like moving hitboxes

◆ forceAnimation

string UnityPlatformer.CharacterActionMelee.forceAnimation = ""

Set forceAnimation at character if not empty

◆ priority

int UnityPlatformer.CharacterActionMelee.priority = 20

Action priority

◆ startTime

float UnityPlatformer.CharacterActionMelee.startTime = 0.0f
protected

When attack started


The documentation for this class was generated from the following file: