Platformer Pro  2.3.2
A platform game kit for Unity.
PlatformerPro.WallMovement_WallClingAndRun Class Reference

A wall movment class that can stick to, climb and slide down walls. The character can also jump from the wall. More...

Inheritance diagram for PlatformerPro.WallMovement_WallClingAndRun:
PlatformerPro.WallMovement_WallCling PlatformerPro.WallMovement PlatformerPro.BaseMovement< WallMovement >

Public Member Functions

override void DoMove ()
 Moves the character. More...
 
override bool ForceMaintainControl ()
 If this is true then the movement wants to maintain control of the character even if default transition conditions suggest it shouldn't. More...
 
override Movement Init (Character character, MovementVariable[] movementData)
 Initialise the movement with the given movement data. More...
 
override bool WantsCling ()
 Gets a value indicating whether this movement wants to intiate a wall clinging behaviour. More...
 
override void DoCling ()
 
override void LosingControl ()
 Called when the movement loses control. Override to do any reset type actions. More...
 
- Public Member Functions inherited from PlatformerPro.WallMovement_WallCling
override void DoMove ()
 Moves the character. More...
 
override Movement Init (Character character, MovementVariable[] movementData)
 Initialise the movement with the given movement data. More...
 
override bool ForceMaintainControl ()
 If this is true then the movement wants to maintain control of the character even if default transition conditions suggest it shouldn't. In this case control unless the character dismounts. More...
 
override void LosingControl ()
 Called when the movement loses control. Override to do any reset type actions. More...
 
- Public Member Functions inherited from PlatformerPro.BaseMovement< WallMovement >
sealed override Movement Init (Character character)
 Initialise this movement. More...
 
bool IsMovementDataDifferent (MovementVariable[] originalMovementData)
 Determines whether this instances movement data is different from the supplied originalMovementData. More...
 

Public Attributes

float climbUpSpeed
 How fast character climbs when the player presses up. More...
 
float clingDrag
 How quickly we come to a halt when the user is not pressing down. More...
 
float slideDownSpeed
 Maximum speed we can slide down (negative). More...
 
float runTimeLimit
 How long we can run for. More...
 
float oppositeLookTimeLimit
 How long we can look in opposite direction for. More...
 
float speedWhereWallJumpEnds
 When doing a jump away from the wall at what speed do we loose control. More...
 
- Public Attributes inherited from PlatformerPro.WallMovement_WallCling
float clingGravity
 The gravity applied whle clining. Use 0 to allow infinite wall cling. More...
 
float gravityDelay
 How long before the (potentially reduced) gravity is applied to a character that is wall clinging. More...
 
float jumpHeight
 How high the character jumps on a wall jump. If 0 character will just fall from wall when jump is pressed. More...
 
float ignoreClingAfterJumpTime
 How long after jumping the character is not able to wall cling. More...
 
bool mustHoldToMaintainCling
 Does the user need to hold towards the wall constantly to maintain the cling? More...
 
float ignoreJumpTime
 How long after clinging to the wall will the jump button be ignored. More...
 

Protected Member Functions

virtual void DoJump ()
 Does the jump More...
 

Protected Attributes

bool isRunning
 Tracks if we are climbing. More...
 
float wallRunTimer
 How long have we been running up the wall. More...
 
bool oppositeLookStarted
 Have we started opposite looking. More...
 
float oppositeLookTimer
 The opposite look timer. We can look as long as this is higher than zero. More...
 
Collider2D cachedWall
 Cached copy of the wall we jumped from More...
 
- Protected Attributes inherited from PlatformerPro.WallMovement_WallCling
float ignoreWallClimbTimer
 While larger than zero the wall cling will be ignored. Usualy set after jumping. More...
 
float ignoreGravityTimer
 While larger than zero no gravity will be applied. More...
 
float ignoreJumpTimer
 While larger than zero player cannot jump off of wall. More...
 
BasicRaycast highestRightCollider
 The highest right collider. More...
 
BasicRaycast highestLeftCollider
 The highest left collider. More...
 
float ableToacceptInputTimer
 If this is non-zero the character is able to press jump in order to wall jump. More...
 
float ableToWallJumpTime = 0.15f
 How long after releaseing the wall can the character still wall jump. TODO: This should be user controllable. More...
 
bool hasJumped
 Tracks if we have jumped. More...
 
bool clingStarted
 Have we started clinging? More...
 
int currentWallDirection
 Cached wall direction. More...
 
- Protected Attributes inherited from PlatformerPro.BaseMovement< WallMovement >
Movement implementation
 The class that will do the movement. More...
 
string movementType
 The type of movement as a string. More...
 
MovementVariable[] movementData
 Data that should be applied to the movement type on init. More...
 

Static Protected Attributes

const int RunSpeedIndex = 8
 The index of the climb up speed in movement data. More...
 
const int SlideDownSpeedIndex = 9
 The index of the side down speed in movement data. More...
 
const int ClingDragIndex = 10
 The index of the cling drad acceleration in movement data. More...
 
const int RunTimeLimitIndex = 11
 The index of the runtime limit in movement data. More...
 
const int OppositeLookTimeIndex = 12
 The index of the opposite look time limit in movement data. More...
 
const int SpeedWhereWallJumpEndsIndex = 13
 When we do wall jump at what y speed do we go back to normal jump. More...
 
new const int MovementVariableCount = 14
 The size of the movement variable array. More...
 
const float DefaultRunSpeed = 2.0f
 The default climb up speed. More...
 
const float DefaultSlideDownSpeed = -5.0f
 The default slide down speed. More...
 
const float DefaultClingDrag = 15.0f
 The default cling drag. More...
 
const float DefaultSpeedWhereWallJumpEnds = -1f
 The default air speed at which jump ends. More...
 
- Static Protected Attributes inherited from PlatformerPro.WallMovement_WallCling
const int ClingGravityIndex = 2
 The index of the property for Cling Gravity. More...
 
const int GravityDelayIndex = 3
 The index of the property for Gravity Delay. More...
 
const int JumpHeightIndex = 4
 The index of the property for Jump height. More...
 
const int IgnoreClingAfterJumpTimeIndex = 5
 The index of the property for IgnoreClingAfterJumpTime. More...
 
const int MustHoldToMaintainClingIndex = 6
 The index of the property for MustHoldToMaintainCling. More...
 
const int IgnoreJumpTimeIndex = 7
 The index of the property for IgnoreJumpTime. More...
 
new const int MovementVariableCount = 8
 The size of the movement variable array. More...
 
const float DefaultJumpHeight = 2.0f
 The default ignore cling time. More...
 
const float DefaultIgnoreJumpTime = 0.2f
 The default ignore jump time. More...
 
const float DefaultIgnoreClingTime = 0.5f
 The default ignore cling time. More...
 
- Static Protected Attributes inherited from PlatformerPro.WallMovement
const int RequiredCollidersIndex = 1
 The index of the property for the required colliders. /// More...
 
const int MovementVariableCount = 2
 The size of the movement variable array. More...
 
const int DefaultRequiredColliders = 2
 The index of the property for the required colliders. /// More...
 

Properties

new static MovementInfo Info [get]
 Static movement info used by the editor. More...
 
override AnimationState AnimationState [get]
 Gets the animation state that this movement wants to set. More...
 
override int AnimationPriority [get]
 Gets the priority of the animation state that this movement wants to set. More...
 
override int FacingDirection [get]
 Returns the direction the character is facing. 0 for none, 1 for right, -1 for left. This overriden version always returns the wall direction. More...
 
override bool ShouldApplyGravity [get]
 Gravity handled internally More...
 
- Properties inherited from PlatformerPro.WallMovement_WallCling
new static MovementInfo Info [get]
 Static movement info used by the editor. More...
 
override AnimationState AnimationState [get]
 Gets the animation state that this movement wants to set. More...
 
override int AnimationPriority [get]
 Gets the priority of the animation state that this movement wants to set. More...
 
override int FacingDirection [get]
 Returns the direction the character is facing. 0 for none, 1 for right, -1 for left. This overriden version always returns the wall direction. More...
 
override bool ShouldApplyGravity [get]
 Gravity handled internally More...
 
- Properties inherited from PlatformerPro.WallMovement
virtual bool ClingToAllWalls [get, protected set]
 If true this applies to all walls and there is no need to use tags or layers to detect walls. More...
 
virtual bool DetectWallsByTag [get, protected set]
 Should we find walls by tag or by layer. If true we will use tags, if false we will use layers. Tags are easier to use but come with an allocation cost. More...
 
virtual string WallLayerOrTagName [get, protected set]
 The name of the wall layer if we find by layers, or the tag name if we find by tags. More...
 
virtual int RequiredColliders [get, protected set]
 The number of colliders required for wall clinging to intiate. Note these colliders don't need to be hitting the same wall just a wall on the same side (so you can move up a wall made of tiled boxes). More...
 
override bool ShouldDoRotations [get]
 Gets a value indicating whether this PlatformerPro.Movement expects the rotations to be calculated and applied by the character. By default walls don't do this. More...
 
new static MovementInfo Info [get]
 Static movement info used by the editor. More...
 
- Properties inherited from PlatformerPro.BaseMovement< WallMovement >
virtual string MovementType [get, set]
 The type of movement as a string. More...
 
virtual MovementVariable[] MovementData [get, set]
 Data that should be applied to the movement type on init. More...
 
new static MovementInfo Info [get]
 Static movement info used by the editor. More...
 
override bool Enabled [get, set]
 A custom enable which base movements can use to pass on enable values. More...
 
override Movement Implementation [get]
 Gets the underlying implementation. More...
 

Detailed Description

A wall movment class that can stick to, climb and slide down walls. The character can also jump from the wall.

Member Function Documentation

◆ DoCling()

override void PlatformerPro.WallMovement_WallClingAndRun.DoCling ( )
virtual

Does the cling.

Reimplemented from PlatformerPro.WallMovement_WallCling.

◆ DoJump()

virtual void PlatformerPro.WallMovement_WallClingAndRun.DoJump ( )
protectedvirtual

Does the jump

◆ DoMove()

override void PlatformerPro.WallMovement_WallClingAndRun.DoMove ( )

Moves the character.

◆ ForceMaintainControl()

override bool PlatformerPro.WallMovement_WallClingAndRun.ForceMaintainControl ( )

If this is true then the movement wants to maintain control of the character even if default transition conditions suggest it shouldn't.

Returns
false always

◆ Init()

override Movement PlatformerPro.WallMovement_WallClingAndRun.Init ( Character  character,
MovementVariable[]  movementData 
)

Initialise the movement with the given movement data.

Parameters
characterCharacter.
movementDataMovement data.

◆ LosingControl()

override void PlatformerPro.WallMovement_WallClingAndRun.LosingControl ( )

Called when the movement loses control. Override to do any reset type actions.

◆ WantsCling()

override bool PlatformerPro.WallMovement_WallClingAndRun.WantsCling ( )
virtual

Gets a value indicating whether this movement wants to intiate a wall clinging behaviour.

Reimplemented from PlatformerPro.WallMovement_WallCling.

Member Data Documentation

◆ cachedWall

Collider2D PlatformerPro.WallMovement_WallClingAndRun.cachedWall
protected

Cached copy of the wall we jumped from

◆ climbUpSpeed

float PlatformerPro.WallMovement_WallClingAndRun.climbUpSpeed

How fast character climbs when the player presses up.

◆ clingDrag

float PlatformerPro.WallMovement_WallClingAndRun.clingDrag

How quickly we come to a halt when the user is not pressing down.

◆ ClingDragIndex

const int PlatformerPro.WallMovement_WallClingAndRun.ClingDragIndex = 10
staticprotected

The index of the cling drad acceleration in movement data.

◆ DefaultClingDrag

const float PlatformerPro.WallMovement_WallClingAndRun.DefaultClingDrag = 15.0f
staticprotected

The default cling drag.

◆ DefaultRunSpeed

const float PlatformerPro.WallMovement_WallClingAndRun.DefaultRunSpeed = 2.0f
staticprotected

The default climb up speed.

◆ DefaultSlideDownSpeed

const float PlatformerPro.WallMovement_WallClingAndRun.DefaultSlideDownSpeed = -5.0f
staticprotected

The default slide down speed.

◆ DefaultSpeedWhereWallJumpEnds

const float PlatformerPro.WallMovement_WallClingAndRun.DefaultSpeedWhereWallJumpEnds = -1f
staticprotected

The default air speed at which jump ends.

◆ isRunning

bool PlatformerPro.WallMovement_WallClingAndRun.isRunning
protected

Tracks if we are climbing.

◆ MovementVariableCount

new const int PlatformerPro.WallMovement_WallClingAndRun.MovementVariableCount = 14
staticprotected

The size of the movement variable array.

◆ oppositeLookStarted

bool PlatformerPro.WallMovement_WallClingAndRun.oppositeLookStarted
protected

Have we started opposite looking.

◆ OppositeLookTimeIndex

const int PlatformerPro.WallMovement_WallClingAndRun.OppositeLookTimeIndex = 12
staticprotected

The index of the opposite look time limit in movement data.

◆ oppositeLookTimeLimit

float PlatformerPro.WallMovement_WallClingAndRun.oppositeLookTimeLimit

How long we can look in opposite direction for.

◆ oppositeLookTimer

float PlatformerPro.WallMovement_WallClingAndRun.oppositeLookTimer
protected

The opposite look timer. We can look as long as this is higher than zero.

◆ RunSpeedIndex

const int PlatformerPro.WallMovement_WallClingAndRun.RunSpeedIndex = 8
staticprotected

The index of the climb up speed in movement data.

◆ runTimeLimit

float PlatformerPro.WallMovement_WallClingAndRun.runTimeLimit

How long we can run for.

◆ RunTimeLimitIndex

const int PlatformerPro.WallMovement_WallClingAndRun.RunTimeLimitIndex = 11
staticprotected

The index of the runtime limit in movement data.

◆ slideDownSpeed

float PlatformerPro.WallMovement_WallClingAndRun.slideDownSpeed

Maximum speed we can slide down (negative).

◆ SlideDownSpeedIndex

const int PlatformerPro.WallMovement_WallClingAndRun.SlideDownSpeedIndex = 9
staticprotected

The index of the side down speed in movement data.

◆ speedWhereWallJumpEnds

float PlatformerPro.WallMovement_WallClingAndRun.speedWhereWallJumpEnds

When doing a jump away from the wall at what speed do we loose control.

◆ SpeedWhereWallJumpEndsIndex

const int PlatformerPro.WallMovement_WallClingAndRun.SpeedWhereWallJumpEndsIndex = 13
staticprotected

When we do wall jump at what y speed do we go back to normal jump.

◆ wallRunTimer

float PlatformerPro.WallMovement_WallClingAndRun.wallRunTimer
protected

How long have we been running up the wall.

Property Documentation

◆ AnimationPriority

override int PlatformerPro.WallMovement_WallClingAndRun.AnimationPriority
get

Gets the priority of the animation state that this movement wants to set.

The animation priority.

◆ AnimationState

override AnimationState PlatformerPro.WallMovement_WallClingAndRun.AnimationState
get

Gets the animation state that this movement wants to set.

◆ FacingDirection

override int PlatformerPro.WallMovement_WallClingAndRun.FacingDirection
get

Returns the direction the character is facing. 0 for none, 1 for right, -1 for left. This overriden version always returns the wall direction.

◆ Info

new static MovementInfo PlatformerPro.WallMovement_WallClingAndRun.Info
staticget

Static movement info used by the editor.

◆ ShouldApplyGravity

override bool PlatformerPro.WallMovement_WallClingAndRun.ShouldApplyGravity
get

Gravity handled internally


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