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

A climb movement for ladder climbing which plays an (uninterruptible) animation at the top of the ladder is reached. WARNING: THIS MOVEMNET CURRENTLY ONLY WORKS SEAMLESLLY WITH 3D CHARACTERS More...

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

Public Member Functions

override Movement Init (Character character, MovementVariable[] movementData)
 Initialise the mvoement with the given movement data. More...
 
override void DoMove ()
 Moves the character. More...
 
override void GainControl ()
 Called when the movement gets control. Typically used to do initialisation of velocity and the like. More...
 
override bool WantsClimb ()
 The digital ladder controller can only work with 2D Box Colliders. More...
 
override bool ForceMaintainControl ()
 Keep control until dismount. More...
 
override void LosingControl ()
 Called when the movement loses control. Override to do any reset type actions. More...
 
- Public Member Functions inherited from PlatformerPro.LadderMovement_DigitalForTiles
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 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 upClimbDistance
 When within this distance we start the up climb. More...
 
Vector2 upClimbOffset
 After the up climb is complete this is the amount we offset the character. More...
 
Vector2 downClimbOffset
 After the down climb is complete this is the amount we offset the character. More...
 
- Public Attributes inherited from PlatformerPro.LadderMovement_DigitalForTiles
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 Attributes

bool upClimbStarted
 Tracks if the up climb has started. More...
 
bool downClimbStarted
 Tracks if the down climb has started. More...
 
bool upClimbOffsetApplied
 Have we applied the up climb offset. More...
 
bool downClimbOffsetApplied
 Have we applied the down climb offset. More...
 
Vector2 ladderTopPosition
 Position of current ladders top. More...
 
Animator myAnimator
 Reference to an animator used to determine if an animation is finished. More...
 
- Protected Attributes inherited from PlatformerPro.LadderMovement_DigitalForTiles
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 UpClimbDistanceIndex = 6
 The index of the up climb distance in the movement data. More...
 
const int UpClimbOffsetIndex = 7
 The index of the up climb offset in the movement data. More...
 
const int DownClimbOffsetIndex = 8
 The index of the down climb offset in the movement data. More...
 
new const int MovementVariableCount = 9
 The size of the movement variable array. More...
 
- Static Protected Attributes inherited from PlatformerPro.LadderMovement_DigitalForTiles
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 AnimationState AnimationState [get]
 Gets the animation state that this movement wants to set. More...
 
- Properties inherited from PlatformerPro.LadderMovement_DigitalForTiles
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...
 

Additional Inherited Members

- Protected Member Functions inherited from PlatformerPro.LadderMovement_DigitalForTiles
virtual bool CheckForLadderBelow (int layer)
 Checks for ladder below. More...
 

Detailed Description

A climb movement for ladder climbing which plays an (uninterruptible) animation at the top of the ladder is reached. WARNING: THIS MOVEMNET CURRENTLY ONLY WORKS SEAMLESLLY WITH 3D CHARACTERS

Member Function Documentation

◆ DoMove()

override void PlatformerPro.LadderMovement_WithTopClimb.DoMove ( )

Moves the character.

◆ ForceMaintainControl()

override bool PlatformerPro.LadderMovement_WithTopClimb.ForceMaintainControl ( )

Keep control until dismount.

◆ GainControl()

override void PlatformerPro.LadderMovement_WithTopClimb.GainControl ( )

Called when the movement gets control. Typically used to do initialisation of velocity and the like.

◆ Init()

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

Initialise the mvoement with the given movement data.

Parameters
characterCharacter.
movementDataMovement data.

◆ LosingControl()

override void PlatformerPro.LadderMovement_WithTopClimb.LosingControl ( )

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

◆ WantsClimb()

override bool PlatformerPro.LadderMovement_WithTopClimb.WantsClimb ( )
virtual

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

true if the character should climb; otherwise, false.

Reimplemented from PlatformerPro.LadderMovement_DigitalForTiles.

Member Data Documentation

◆ downClimbOffset

Vector2 PlatformerPro.LadderMovement_WithTopClimb.downClimbOffset

After the down climb is complete this is the amount we offset the character.

◆ downClimbOffsetApplied

bool PlatformerPro.LadderMovement_WithTopClimb.downClimbOffsetApplied
protected

Have we applied the down climb offset.

◆ DownClimbOffsetIndex

const int PlatformerPro.LadderMovement_WithTopClimb.DownClimbOffsetIndex = 8
staticprotected

The index of the down climb offset in the movement data.

◆ downClimbStarted

bool PlatformerPro.LadderMovement_WithTopClimb.downClimbStarted
protected

Tracks if the down climb has started.

◆ ladderTopPosition

Vector2 PlatformerPro.LadderMovement_WithTopClimb.ladderTopPosition
protected

Position of current ladders top.

◆ MovementVariableCount

new const int PlatformerPro.LadderMovement_WithTopClimb.MovementVariableCount = 9
staticprotected

The size of the movement variable array.

◆ myAnimator

Animator PlatformerPro.LadderMovement_WithTopClimb.myAnimator
protected

Reference to an animator used to determine if an animation is finished.

◆ upClimbDistance

float PlatformerPro.LadderMovement_WithTopClimb.upClimbDistance

When within this distance we start the up climb.

◆ UpClimbDistanceIndex

const int PlatformerPro.LadderMovement_WithTopClimb.UpClimbDistanceIndex = 6
staticprotected

The index of the up climb distance in the movement data.

◆ upClimbOffset

Vector2 PlatformerPro.LadderMovement_WithTopClimb.upClimbOffset

After the up climb is complete this is the amount we offset the character.

◆ upClimbOffsetApplied

bool PlatformerPro.LadderMovement_WithTopClimb.upClimbOffsetApplied
protected

Have we applied the up climb offset.

◆ UpClimbOffsetIndex

const int PlatformerPro.LadderMovement_WithTopClimb.UpClimbOffsetIndex = 7
staticprotected

The index of the up climb offset in the movement data.

◆ upClimbStarted

bool PlatformerPro.LadderMovement_WithTopClimb.upClimbStarted
protected

Tracks if the up climb has started.

Property Documentation

◆ AnimationState

override AnimationState PlatformerPro.LadderMovement_WithTopClimb.AnimationState
get

Gets the animation state that this movement wants to set.

◆ Info

new static MovementInfo PlatformerPro.LadderMovement_WithTopClimb.Info
staticget

Static movement info used by the editor.


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