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

Climb a ladder More...

Inheritance diagram for UnityPlatformer.CharacterActionLadder:
UnityPlatformer.CharacterAction

Public Member Functions

override void OnEnable ()
 keep Character.actions in sync More...
 
override int WantsToUpdate (float delta)
 Enter in ladder mode when user is in a ladder area and pressing up/down More...
 
override void GainControl (float delta)
 EnterState and start centering 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 LoseControl (float delta)
 Called (once) when other action 'WantsToUpdate' or this action don't anymore More...
 

Public Attributes

float speed = 6
 Ladder movement speed. More...
 
bool moveToCenter = false
 Move character to the center of the ladder, instantly More...
 
float towardsSpeed = 32
 Maximum speed to snap to the center. More...
 
float towardsTime = 0.1f
 Time to reach the center (if towardsSpeed is fast enough). More...
 
bool leftRightDismount = true
 Dismount pressing left/right More...
 
float dismountTime = 0.2f
 Time left/right need to be pressed to dismount More...
 
bool dismountJumping = true
 Character can dismount ladders jumping? More...
 
JumpConstantProperties jumpOff = new JumpConstantProperties(new Vector2(20, 20))
 Jump with no direction pressed. More...
 
int priority = 10
 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

Climb a ladder

Member Function Documentation

◆ GainControl()

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

EnterState and start centering

Reimplemented from UnityPlatformer.CharacterAction.

◆ GetPostUpdateActions()

override PostUpdateActions UnityPlatformer.CharacterActionLadder.GetPostUpdateActions ( )
inlinevirtual

Return what to do next.

By default should be: APPLY_GRAVITY | WORLD_COLLISIONS

Implements UnityPlatformer.CharacterAction.

◆ OnEnable()

override void UnityPlatformer.CharacterActionLadder.OnEnable ( )
inlinevirtual

keep Character.actions in sync

Reimplemented from UnityPlatformer.CharacterAction.

◆ PerformAction()

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

Do your action here.

Implements UnityPlatformer.CharacterAction.

◆ WantsToUpdate()

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

Enter in ladder mode when user is in a ladder area and pressing up/down

Implements UnityPlatformer.CharacterAction.

Member Data Documentation

◆ dismountJumping

bool UnityPlatformer.CharacterActionLadder.dismountJumping = true

Character can dismount ladders jumping?

◆ dismountTime

float UnityPlatformer.CharacterActionLadder.dismountTime = 0.2f

Time left/right need to be pressed to dismount

◆ jumpOff

JumpConstantProperties UnityPlatformer.CharacterActionLadder.jumpOff = new JumpConstantProperties(new Vector2(20, 20))

Jump with no direction pressed.

◆ leftRightDismount

bool UnityPlatformer.CharacterActionLadder.leftRightDismount = true

Dismount pressing left/right

◆ moveToCenter

bool UnityPlatformer.CharacterActionLadder.moveToCenter = false

Move character to the center of the ladder, instantly

◆ priority

int UnityPlatformer.CharacterActionLadder.priority = 10

Action priority

◆ speed

float UnityPlatformer.CharacterActionLadder.speed = 6

Ladder movement speed.

◆ towardsSpeed

float UnityPlatformer.CharacterActionLadder.towardsSpeed = 32

Maximum speed to snap to the center.

◆ towardsTime

float UnityPlatformer.CharacterActionLadder.towardsTime = 0.1f

Time to reach the center (if towardsSpeed is fast enough).


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