platformer
Public Member Functions | Public Attributes | List of all members
UnityPlatformer.CharacterActionJump Class Reference

Jump while on ground. More...

Inheritance diagram for UnityPlatformer.CharacterActionJump:
UnityPlatformer.CharacterAction

Public Member Functions

override void OnEnable ()
 keep Character.actions in sync More...
 
void OnActionDown (string _action)
 input.onActionDown callback More...
 
void OnActionUp (string _action)
 input.onActionUp callback More...
 
void ForceJump (Jump j)
 Force Character to Jump! More...
 
void Jump (Jump j)
 Try to jump More...
 
override int WantsToUpdate (float delta)
 Listen input and Select the current Jump 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.CharacterAction
void Reset ()
 Try to set character & input from parent nodes 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

JumpVariableHeightProperties jumpProperties
 Jump Properties More...
 
String action = "Jump"
 Input action name More...
 
int priority = 5
 Action priority 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...
 

Detailed Description

Jump while on ground.

The rest jumps, are managed here, but using jump properties/type elsewhere, just by calling Jump() / ForceJump()
NOTE unity-platformer support multiple types of jumps. We just ship one type here, be free to extend!
NOTE executionOrder should be -20
TODO force one jump per press, force to release before another jump

Member Function Documentation

◆ ForceJump()

void UnityPlatformer.CharacterActionJump.ForceJump ( Jump  j)
inline

Force Character to Jump!

User must be sure of what they are doing... this doesn't check anything

◆ GetPostUpdateActions()

override PostUpdateActions UnityPlatformer.CharacterActionJump.GetPostUpdateActions ( )
inlinevirtual

Return what to do next.

By default should be: APPLY_GRAVITY | WORLD_COLLISIONS

Implements UnityPlatformer.CharacterAction.

◆ Jump()

void UnityPlatformer.CharacterActionJump.Jump ( Jump  j)
inline

Try to jump

◆ OnActionDown()

void UnityPlatformer.CharacterActionJump.OnActionDown ( string  _action)
inline

input.onActionDown callback

◆ OnActionUp()

void UnityPlatformer.CharacterActionJump.OnActionUp ( string  _action)
inline

input.onActionUp callback

◆ OnEnable()

override void UnityPlatformer.CharacterActionJump.OnEnable ( )
inlinevirtual

keep Character.actions in sync

Reimplemented from UnityPlatformer.CharacterAction.

◆ PerformAction()

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

Do your action here.

Implements UnityPlatformer.CharacterAction.

◆ WantsToUpdate()

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

Listen input and Select the current Jump

Other actions (with higher priority) can trigger Jumps using Jump(), and the next Frame CharacterActionJump willl take control!

Implements UnityPlatformer.CharacterAction.

Member Data Documentation

◆ action

String UnityPlatformer.CharacterActionJump.action = "Jump"

Input action name

◆ jumpProperties

JumpVariableHeightProperties UnityPlatformer.CharacterActionJump.jumpProperties

Jump Properties

◆ priority

int UnityPlatformer.CharacterActionJump.priority = 5

Action priority


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