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

Fire projectiles (All or one by one), handles orientation based on the character collisions.faceDir More...

Inheritance diagram for UnityPlatformer.CharacterActionProjectile:
UnityPlatformer.CharacterAction

Classes

struct  ProjectileCfg
 Projectiles data More...
 

Public Member Functions

override int WantsToUpdate (float delta)
 TODO REVIEW continous fire? More...
 
override void PerformAction (float delta)
 Do your action here. More...
 
virtual void Fire ()
 Fire projectiles, regardless the cooldown, Call it after all checks More...
 
override PostUpdateActions GetPostUpdateActions ()
 Return what to do next. More...
 
- Public Member Functions inherited from UnityPlatformer.CharacterAction
void Reset ()
 Try to set character & input from parent nodes More...
 
virtual void OnEnable ()
 keep Character.actions in sync More...
 
virtual void OnDisable ()
 keep Character.actions in sync More...
 
virtual void GainControl (float delta)
 Called (once) when this action is going to be 'PerformAction' for first time More...
 
virtual void LoseControl (float delta)
 Called (once) when other action 'WantsToUpdate' or this action don't anymore More...
 

Public Attributes

String action = "Attack"
 Input action name More...
 
List< ProjectileCfgprojectiles = new List<ProjectileCfg>()
 List of projectiles More...
 
float fireDelay = 5
 Reload time More...
 
bool fireMode = false
 
int priority = 5
 Action priority More...
 
Action onFire
 Fired when fire a projectile 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 Member Functions

virtual void _Fire ()
 Real Fire function, for use with: UpdateManager.SetTimeout More...
 

Detailed Description

Fire projectiles (All or one by one), handles orientation based on the character collisions.faceDir

Member Function Documentation

◆ _Fire()

virtual void UnityPlatformer.CharacterActionProjectile._Fire ( )
inlineprotectedvirtual

Real Fire function, for use with: UpdateManager.SetTimeout

◆ Fire()

virtual void UnityPlatformer.CharacterActionProjectile.Fire ( )
inlinevirtual

Fire projectiles, regardless the cooldown, Call it after all checks

◆ GetPostUpdateActions()

override PostUpdateActions UnityPlatformer.CharacterActionProjectile.GetPostUpdateActions ( )
inlinevirtual

Return what to do next.

By default should be: APPLY_GRAVITY | WORLD_COLLISIONS

Implements UnityPlatformer.CharacterAction.

◆ PerformAction()

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

Do your action here.

Implements UnityPlatformer.CharacterAction.

◆ WantsToUpdate()

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

TODO REVIEW continous fire?

Implements UnityPlatformer.CharacterAction.

Member Data Documentation

◆ action

String UnityPlatformer.CharacterActionProjectile.action = "Attack"

Input action name

◆ fireDelay

float UnityPlatformer.CharacterActionProjectile.fireDelay = 5

Reload time

◆ fireMode

bool UnityPlatformer.CharacterActionProjectile.fireMode = false

  • true: Fire all at once (with given delays).
  • false: Fire one by one

◆ onFire

Action UnityPlatformer.CharacterActionProjectile.onFire

Fired when fire a projectile

◆ priority

int UnityPlatformer.CharacterActionProjectile.priority = 5

Action priority

◆ projectiles

List<ProjectileCfg> UnityPlatformer.CharacterActionProjectile.projectiles = new List<ProjectileCfg>()

List of projectiles


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