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

Rope climb More...

Inheritance diagram for UnityPlatformer.CharacterActionRope:
UnityPlatformer.CharacterAction

Public Member Functions

override void OnEnable ()
 keep Character.actions in sync More...
 
override int WantsToUpdate (float delta)
 Tells the character we want to take control More...
 
override void GainControl (float delta)
 EnterState and start centering and listen rope breakage More...
 
override void LoseControl (float delta)
 stop listenting rope break More...
 
override void PerformAction (float delta)
 Move up/down and sync with Rope movement More...
 
override PostUpdateActions GetPostUpdateActions ()
 Do nothing, while on a Rope there shoud be no world to collide 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...
 

Public Attributes

float climbSpeed = 6
 Climb speed More...
 
float towardsSpeed = 32
 Max speed to snap to the center. More...
 
float towardsTime = 0.1f
 Time to reach the center (if towardsSpeed is fast enough). More...
 
bool moveToCenter = false
 Move character to the center of the Rope More...
 
Vector3 grabbingOffset = new Vector3(0, 0, 0)
 Character offset position while grabbing More...
 
bool dismountJumping = true
 Character can dismount pressing jump More...
 
JumpConstantProperties jumpOff = new JumpConstantProperties(new Vector2(20, 20))
 Dismount jump properties More...
 
int priority = 20
 Action priority More...
 
float grabAgainCooldown = 0.25f
 Time to wait before grab again a Rope, should be enough to let the player leave the Rope Area 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

Rope climb

Member Function Documentation

◆ GainControl()

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

EnterState and start centering and listen rope breakage

TODO set positionOfSection = 0.5f, we should calc the closest...

Reimplemented from UnityPlatformer.CharacterAction.

◆ GetPostUpdateActions()

override PostUpdateActions UnityPlatformer.CharacterActionRope.GetPostUpdateActions ( )
inlinevirtual

Do nothing, while on a Rope there shoud be no world to collide

Implements UnityPlatformer.CharacterAction.

◆ LoseControl()

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

stop listenting rope break

Reimplemented from UnityPlatformer.CharacterAction.

◆ OnEnable()

override void UnityPlatformer.CharacterActionRope.OnEnable ( )
inlinevirtual

keep Character.actions in sync

Reimplemented from UnityPlatformer.CharacterAction.

◆ PerformAction()

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

Move up/down and sync with Rope movement

Implements UnityPlatformer.CharacterAction.

◆ WantsToUpdate()

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

Tells the character we want to take control

  • Positive numbers fight: Higher number wins
  • Negative numbers are used to ignore fight and force Character to call PerformAction, but! because it doesn't win the fight onLoseControl, onGrainControl and GetPostUpdateActions are ignored.
    NOTE can be used as a replace for UpdateManager.PlatformerUpdate

Implements UnityPlatformer.CharacterAction.

Member Data Documentation

◆ climbSpeed

float UnityPlatformer.CharacterActionRope.climbSpeed = 6

Climb speed

◆ dismountJumping

bool UnityPlatformer.CharacterActionRope.dismountJumping = true

Character can dismount pressing jump

◆ grabAgainCooldown

float UnityPlatformer.CharacterActionRope.grabAgainCooldown = 0.25f

Time to wait before grab again a Rope, should be enough to let the player leave the Rope Area

◆ grabbingOffset

Vector3 UnityPlatformer.CharacterActionRope.grabbingOffset = new Vector3(0, 0, 0)

Character offset position while grabbing

◆ jumpOff

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

Dismount jump properties

◆ moveToCenter

bool UnityPlatformer.CharacterActionRope.moveToCenter = false

Move character to the center of the Rope

◆ priority

int UnityPlatformer.CharacterActionRope.priority = 20

Action priority

◆ towardsSpeed

float UnityPlatformer.CharacterActionRope.towardsSpeed = 32

Max speed to snap to the center.

◆ towardsTime

float UnityPlatformer.CharacterActionRope.towardsTime = 0.1f

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


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