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

A climb movement for ladder climbing with strict digital style controls and made for supporting tile based levels where one ladder may be made of multiple tiles. More...

Inheritance diagram for PlatformerPro.LadderMovement_DigitalForTiles:
PlatformerPro.ClimbMovement PlatformerPro.BaseMovement< ClimbMovement > PlatformerPro.LadderMovement_WithTopClimb

Public Member Functions

override void DoMove ()
 Moves the character. More...
 
override Movement Init (Character character, MovementVariable[] movementData)
 Initialise the mvoement with the given movement data. More...
 
override bool WantsClimb ()
 The digital ladder controller can only work with 2D Box Colliders. More...
 
override bool ForceMaintainControl ()
 Keep control until dismount. More...
 
- Public Member Functions inherited from PlatformerPro.BaseMovement< ClimbMovement >
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 climbSpeed
 The speed the character climbs at. More...
 
float leeway
 The character can only engage the ladder if the distance in X between their transform and the ladders transform is smaller than this. More...
 
float centeringRate
 The speed at which the character moves towards the centre of the ladder. More...
 
int availableDismounts
 Enum mask More...
 

Protected Member Functions

virtual bool CheckForLadderBelow (int layer)
 Checks for ladder below. More...
 

Protected Attributes

BoxCollider2D ladderCollider
 Reference to the box2D collider defining the ladder. More...
 
bool centered
 Has the character centered on the ladder yet? More...
 
bool dismount
 If the user is dismounting we will relinquish control. More...
 
bool jumpDismount
 When a character jumps while holding up or down you don't want them to automatically stick back on the ladder. We track if the way they dismounted was a jump, and if it was we only stick back to the ladder when the velocity is smaller than 0. More...
 
LadderFacingDirectionOverride facingDirectionOverride
 Nullable reference to a facing direciton override. More...
 
ParentOnStandPlatform parentPlatform
 Stores parent platform if one is found. More...
 
- Protected Attributes inherited from PlatformerPro.BaseMovement< ClimbMovement >
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 MovementVariableCount = 6
 The size of the movement variable array. More...
 
const float DefaultClimbSpeed = 3.0f
 The default climb speed. More...
 
const float DefaultLeeway = 0.5f
 The default leeway. More...
 
const float DefaultCenteringRate = 1.0f
 The default leeway. More...
 
const int DefaultAvailableDismounts = (int)LadderDismountType.TOP_BOTTOM_AND_JUMP_AND_LEFT_RIGHT
 The default available dismounts. More...
 

Properties

new static MovementInfo Info [get]
 Static movement info used by the editor. More...
 
override bool ShouldApplyGravity [get]
 No gravity when climbing. More...
 
override RaycastType ShouldDoBaseCollisions [get]
 Ignore collisions when climbing. More...
 
override AnimationState AnimationState [get]
 Gets the animation state that this movement wants to set. More...
 
- Properties inherited from PlatformerPro.ClimbMovement
virtual bool DetectLaddersByTag [get, protected set]
 Should we find ladders 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 LadderLayerOrTagName [get, protected set]
 The name of the ladder lyaer if we find by layers, or the tag name if we find by tags. 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 ladders don't do this. More...
 
new static MovementInfo Info [get]
 Static movement info used by the editor. More...
 
- Properties inherited from PlatformerPro.BaseMovement< ClimbMovement >
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 climb movement for ladder climbing with strict digital style controls and made for supporting tile based levels where one ladder may be made of multiple tiles.

Member Function Documentation

◆ CheckForLadderBelow()

virtual bool PlatformerPro.LadderMovement_DigitalForTiles.CheckForLadderBelow ( int  layer)
protectedvirtual

Checks for ladder below.

Returns
true, if ladder tile found below, false otherwise.
Parameters
layerLayer of ladder.

◆ DoMove()

override void PlatformerPro.LadderMovement_DigitalForTiles.DoMove ( )

Moves the character.

◆ ForceMaintainControl()

override bool PlatformerPro.LadderMovement_DigitalForTiles.ForceMaintainControl ( )

Keep control until dismount.

◆ Init()

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

Initialise the mvoement with the given movement data.

Parameters
characterCharacter.
movementDataMovement data.

◆ WantsClimb()

override bool PlatformerPro.LadderMovement_DigitalForTiles.WantsClimb ( )
virtual

The digital ladder controller can only work with 2D Box Colliders.

true if the character should climb; otherwise, false.

Reimplemented from PlatformerPro.ClimbMovement.

Reimplemented in PlatformerPro.LadderMovement_WithTopClimb.

Member Data Documentation

◆ availableDismounts

int PlatformerPro.LadderMovement_DigitalForTiles.availableDismounts

Enum mask

◆ centered

bool PlatformerPro.LadderMovement_DigitalForTiles.centered
protected

Has the character centered on the ladder yet?

◆ centeringRate

float PlatformerPro.LadderMovement_DigitalForTiles.centeringRate

The speed at which the character moves towards the centre of the ladder.

◆ climbSpeed

float PlatformerPro.LadderMovement_DigitalForTiles.climbSpeed

The speed the character climbs at.

◆ DefaultAvailableDismounts

const int PlatformerPro.LadderMovement_DigitalForTiles.DefaultAvailableDismounts = (int)LadderDismountType.TOP_BOTTOM_AND_JUMP_AND_LEFT_RIGHT
staticprotected

The default available dismounts.

◆ DefaultCenteringRate

const float PlatformerPro.LadderMovement_DigitalForTiles.DefaultCenteringRate = 1.0f
staticprotected

The default leeway.

◆ DefaultClimbSpeed

const float PlatformerPro.LadderMovement_DigitalForTiles.DefaultClimbSpeed = 3.0f
staticprotected

The default climb speed.

◆ DefaultLeeway

const float PlatformerPro.LadderMovement_DigitalForTiles.DefaultLeeway = 0.5f
staticprotected

The default leeway.

◆ dismount

bool PlatformerPro.LadderMovement_DigitalForTiles.dismount
protected

If the user is dismounting we will relinquish control.

◆ facingDirectionOverride

LadderFacingDirectionOverride PlatformerPro.LadderMovement_DigitalForTiles.facingDirectionOverride
protected

Nullable reference to a facing direciton override.

◆ jumpDismount

bool PlatformerPro.LadderMovement_DigitalForTiles.jumpDismount
protected

When a character jumps while holding up or down you don't want them to automatically stick back on the ladder. We track if the way they dismounted was a jump, and if it was we only stick back to the ladder when the velocity is smaller than 0.

◆ ladderCollider

BoxCollider2D PlatformerPro.LadderMovement_DigitalForTiles.ladderCollider
protected

Reference to the box2D collider defining the ladder.

◆ leeway

float PlatformerPro.LadderMovement_DigitalForTiles.leeway

The character can only engage the ladder if the distance in X between their transform and the ladders transform is smaller than this.

◆ MovementVariableCount

const int PlatformerPro.LadderMovement_DigitalForTiles.MovementVariableCount = 6
staticprotected

The size of the movement variable array.

◆ parentPlatform

ParentOnStandPlatform PlatformerPro.LadderMovement_DigitalForTiles.parentPlatform
protected

Stores parent platform if one is found.

Property Documentation

◆ AnimationState

override AnimationState PlatformerPro.LadderMovement_DigitalForTiles.AnimationState
get

Gets the animation state that this movement wants to set.

◆ Info

new static MovementInfo PlatformerPro.LadderMovement_DigitalForTiles.Info
staticget

Static movement info used by the editor.

◆ ShouldApplyGravity

override bool PlatformerPro.LadderMovement_DigitalForTiles.ShouldApplyGravity
get

No gravity when climbing.

◆ ShouldDoBaseCollisions

override RaycastType PlatformerPro.LadderMovement_DigitalForTiles.ShouldDoBaseCollisions
get

Ignore collisions when climbing.


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