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

A climb movement which allows you to move only horizontally. More...

Inheritance diagram for PlatformerPro.ClimbMovement_HorizontalOnly:
PlatformerPro.ClimbMovement PlatformerPro.BaseMovement< ClimbMovement >

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 horizontalSpeed
 The speed the character moves horizontally at. More...
 
int requiredColliders
 The required colliders hitting the fence for climb to start. More...
 
int availableDismounts
 Enum mask. More...
 

Protected Member Functions

virtual void MoveInY ()
 Does the Y movement. More...
 
virtual void MoveInX ()
 Does the X movement. More...
 

Protected Attributes

BoxCollider2D ladderCollider
 Reference to the box2D collider defining the ladder. 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...
 
bool centered
 Tracks if we are centered or not. More...
 
float centeringRate = 5.0f
 How fast we move to centre position. More...
 
float centrePosition
 Centre position. More...
 
float dismountTime = 1.0f
 The dismount time. More...
 
float dismountTimer
 The dismount timer. 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 = 4
 The size of the movement variable array. More...
 
const float DefaultClimbSpeed = 3.0f
 The default climb speed. More...
 
const int DefaultRequiredColliders = 3
 The default leeway. More...
 
const int DefaultAvailableDismounts = (int)LadderDismountType.TOP_BOTTOM_AND_JUMP
 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 which allows you to move only horizontally.

Member Function Documentation

◆ DoMove()

override void PlatformerPro.ClimbMovement_HorizontalOnly.DoMove ( )

Moves the character.

◆ ForceMaintainControl()

override bool PlatformerPro.ClimbMovement_HorizontalOnly.ForceMaintainControl ( )

Keep control until dismount.

◆ Init()

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

Initialise the mvoement with the given movement data.

Parameters
characterCharacter.
movementDataMovement data.

◆ MoveInX()

virtual void PlatformerPro.ClimbMovement_HorizontalOnly.MoveInX ( )
protectedvirtual

Does the X movement.

◆ MoveInY()

virtual void PlatformerPro.ClimbMovement_HorizontalOnly.MoveInY ( )
protectedvirtual

Does the Y movement.

◆ WantsClimb()

override bool PlatformerPro.ClimbMovement_HorizontalOnly.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.

Member Data Documentation

◆ availableDismounts

int PlatformerPro.ClimbMovement_HorizontalOnly.availableDismounts

Enum mask.

◆ centered

bool PlatformerPro.ClimbMovement_HorizontalOnly.centered
protected

Tracks if we are centered or not.

◆ centeringRate

float PlatformerPro.ClimbMovement_HorizontalOnly.centeringRate = 5.0f
protected

How fast we move to centre position.

◆ centrePosition

float PlatformerPro.ClimbMovement_HorizontalOnly.centrePosition
protected

Centre position.

◆ climbSpeed

float PlatformerPro.ClimbMovement_HorizontalOnly.climbSpeed

The speed the character climbs at.

◆ DefaultAvailableDismounts

const int PlatformerPro.ClimbMovement_HorizontalOnly.DefaultAvailableDismounts = (int)LadderDismountType.TOP_BOTTOM_AND_JUMP
staticprotected

The default available dismounts.

◆ DefaultClimbSpeed

const float PlatformerPro.ClimbMovement_HorizontalOnly.DefaultClimbSpeed = 3.0f
staticprotected

The default climb speed.

◆ DefaultRequiredColliders

const int PlatformerPro.ClimbMovement_HorizontalOnly.DefaultRequiredColliders = 3
staticprotected

The default leeway.

◆ dismount

bool PlatformerPro.ClimbMovement_HorizontalOnly.dismount
protected

If the user is dismounting we will relinquish control.

◆ dismountTime

float PlatformerPro.ClimbMovement_HorizontalOnly.dismountTime = 1.0f
protected

The dismount time.

◆ dismountTimer

float PlatformerPro.ClimbMovement_HorizontalOnly.dismountTimer
protected

The dismount timer.

◆ horizontalSpeed

float PlatformerPro.ClimbMovement_HorizontalOnly.horizontalSpeed

The speed the character moves horizontally at.

◆ jumpDismount

bool PlatformerPro.ClimbMovement_HorizontalOnly.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.ClimbMovement_HorizontalOnly.ladderCollider
protected

Reference to the box2D collider defining the ladder.

◆ MovementVariableCount

const int PlatformerPro.ClimbMovement_HorizontalOnly.MovementVariableCount = 4
staticprotected

The size of the movement variable array.

◆ requiredColliders

int PlatformerPro.ClimbMovement_HorizontalOnly.requiredColliders

The required colliders hitting the fence for climb to start.

Property Documentation

◆ AnimationState

override AnimationState PlatformerPro.ClimbMovement_HorizontalOnly.AnimationState
get

Gets the animation state that this movement wants to set.

◆ Info

new static MovementInfo PlatformerPro.ClimbMovement_HorizontalOnly.Info
staticget

Static movement info used by the editor.

◆ ShouldApplyGravity

override bool PlatformerPro.ClimbMovement_HorizontalOnly.ShouldApplyGravity
get

No gravity when climbing.

◆ ShouldDoBaseCollisions

override RaycastType PlatformerPro.ClimbMovement_HorizontalOnly.ShouldDoBaseCollisions
get

Ignore collisions when climbing.


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