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

A wall movement class that automatically sticks to walls and can only be dismounted by pressing jump. More...

Inheritance diagram for PlatformerPro.WallMovement_AutoStick:
PlatformerPro.WallMovement PlatformerPro.BaseMovement< WallMovement >

Public Member Functions

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 WantsCling ()
 Gets a value indicating whether this movement wants to intiate a wall clinging behaviour. More...
 
override void DoCling ()
 
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 clingGravity
 The gravity applied while clinging. Use 0 to allow infinite wall cling. 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 awayDistance
 How far the character jumps away from the wall before giving back control to player. More...
 
float airSpeed
 The horizontal movement speed when jumping away from the wall. More...
 
float airSpeedRun
 The horizontal movement speed when jumping away from the wall with run depressed. More...
 

Protected Attributes

float initialVelocity
 Derived initial velocity based on jumpHeight and relative gravity. More...
 
bool movingAwayFromWall
 Currently moving away from wall? More...
 
float currentWallX
 Cached copy of the current walls x position (in world space). More...
 
int cachedWallDirection
 What was the wall direction for the last wall? 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 ClingGravityIndex = 2
 The index of the property for Cling Gravity. More...
 
const int JumpHeightIndex = 3
 The index of the property for Gravity Delay. More...
 
const int AwayDistanceIndex = 4
 The index of the property for Jump height. More...
 
const int AirSpeedIndex = 5
 The index of the property for air speed. More...
 
const int AirSpeedRunIndex = 6
 The index of the property for air speed with run depressed. More...
 
new const int MovementVariableCount = 7
 The size of the movement variable array. More...
 
const float DefaultClingGravity = -10.0f
 The default cling gravity. More...
 
const float DefaultJumpHeight = 2.0f
 The default height of the jump. More...
 
const float DefaultAwayDistance = 1.0f
 The default away distance. More...
 
const float DefaultAirSpeed = 4.0f
 The default air speed. More...
 
const float DefaultAirSpeedRun = 7.0f
 The default air speed run. 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 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 movement class that automatically sticks to walls and can only be dismounted by pressing jump.

Member Function Documentation

◆ DoCling()

override void PlatformerPro.WallMovement_AutoStick.DoCling ( )
virtual

Does the cling.

Reimplemented from PlatformerPro.WallMovement.

◆ DoMove()

override void PlatformerPro.WallMovement_AutoStick.DoMove ( )

Moves the character.

◆ ForceMaintainControl()

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

◆ Init()

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

Initialise the movement with the given movement data.

Parameters
characterCharacter.
movementDataMovement data.

◆ LosingControl()

override void PlatformerPro.WallMovement_AutoStick.LosingControl ( )

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

◆ WantsCling()

override bool PlatformerPro.WallMovement_AutoStick.WantsCling ( )
virtual

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

Reimplemented from PlatformerPro.WallMovement.

Member Data Documentation

◆ airSpeed

float PlatformerPro.WallMovement_AutoStick.airSpeed

The horizontal movement speed when jumping away from the wall.

◆ AirSpeedIndex

const int PlatformerPro.WallMovement_AutoStick.AirSpeedIndex = 5
staticprotected

The index of the property for air speed.

◆ airSpeedRun

float PlatformerPro.WallMovement_AutoStick.airSpeedRun

The horizontal movement speed when jumping away from the wall with run depressed.

◆ AirSpeedRunIndex

const int PlatformerPro.WallMovement_AutoStick.AirSpeedRunIndex = 6
staticprotected

The index of the property for air speed with run depressed.

◆ awayDistance

float PlatformerPro.WallMovement_AutoStick.awayDistance

How far the character jumps away from the wall before giving back control to player.

◆ AwayDistanceIndex

const int PlatformerPro.WallMovement_AutoStick.AwayDistanceIndex = 4
staticprotected

The index of the property for Jump height.

◆ cachedWallDirection

int PlatformerPro.WallMovement_AutoStick.cachedWallDirection
protected

What was the wall direction for the last wall?

◆ clingGravity

float PlatformerPro.WallMovement_AutoStick.clingGravity

The gravity applied while clinging. Use 0 to allow infinite wall cling.

◆ ClingGravityIndex

const int PlatformerPro.WallMovement_AutoStick.ClingGravityIndex = 2
staticprotected

The index of the property for Cling Gravity.

◆ currentWallX

float PlatformerPro.WallMovement_AutoStick.currentWallX
protected

Cached copy of the current walls x position (in world space).

◆ DefaultAirSpeed

const float PlatformerPro.WallMovement_AutoStick.DefaultAirSpeed = 4.0f
staticprotected

The default air speed.

◆ DefaultAirSpeedRun

const float PlatformerPro.WallMovement_AutoStick.DefaultAirSpeedRun = 7.0f
staticprotected

The default air speed run.

◆ DefaultAwayDistance

const float PlatformerPro.WallMovement_AutoStick.DefaultAwayDistance = 1.0f
staticprotected

The default away distance.

◆ DefaultClingGravity

const float PlatformerPro.WallMovement_AutoStick.DefaultClingGravity = -10.0f
staticprotected

The default cling gravity.

◆ DefaultJumpHeight

const float PlatformerPro.WallMovement_AutoStick.DefaultJumpHeight = 2.0f
staticprotected

The default height of the jump.

◆ initialVelocity

float PlatformerPro.WallMovement_AutoStick.initialVelocity
protected

Derived initial velocity based on jumpHeight and relative gravity.

◆ jumpHeight

float PlatformerPro.WallMovement_AutoStick.jumpHeight

How high the character jumps on a wall jump. If 0 character will just fall from wall when jump is pressed.

◆ JumpHeightIndex

const int PlatformerPro.WallMovement_AutoStick.JumpHeightIndex = 3
staticprotected

The index of the property for Gravity Delay.

◆ MovementVariableCount

new const int PlatformerPro.WallMovement_AutoStick.MovementVariableCount = 7
staticprotected

The size of the movement variable array.

◆ movingAwayFromWall

bool PlatformerPro.WallMovement_AutoStick.movingAwayFromWall
protected

Currently moving away from wall?

Property Documentation

◆ AnimationState

override AnimationState PlatformerPro.WallMovement_AutoStick.AnimationState
get

Gets the animation state that this movement wants to set.

◆ FacingDirection

override int PlatformerPro.WallMovement_AutoStick.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_AutoStick.Info
staticget

Static movement info used by the editor.

◆ ShouldApplyGravity

override bool PlatformerPro.WallMovement_AutoStick.ShouldApplyGravity
get

Gravity handled internally


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