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

Ground movement for walking up and down stairs. More...

Inheritance diagram for PlatformerPro.GroundMovement_Stairs:
PlatformerPro.GroundMovement PlatformerPro.BaseMovement< GroundMovement >

Public Member Functions

override Movement Init (Character character, MovementVariable[] movementData)
 Initialise the movement with the given movement data (movemnt data is ignored as its not used by this movement). More...
 
override bool WantsGroundControl ()
 Gets a value indicating whether this movement wants to control the movement on the ground. Default is false, with control falling back to default ground. Override if you want particular control. More...
 
override void GainControl ()
 Called when the movement gets control. Typically used to do initialisation of velocity and the like. More...
 
override void LosingControl ()
 Called when the movement loses control. Override to do any reset type actions. More...
 
override void DoMove ()
 Moves the character. More...
 
override bool IsGrounded ()
 Always grounded when on a step. More...
 
- Public Member Functions inherited from PlatformerPro.GroundMovement
virtual void ApplySlopeForce ()
 Applies slope force. More...
 
virtual float ApplySlopeSpeedModifier (float speed)
 Adjusts speed to cater for vertical movement More...
 
virtual float GetSpeed (float baseSpeed)
 Gets the ground speed. More...
 
virtual float GetRunSpeed (float baseRunSpeed)
 Gets the run speed. More...
 
virtual float GetAcceleration (float baseAcceleration)
 Gets the acceleration. More...
 
- Public Member Functions inherited from PlatformerPro.BaseMovement< GroundMovement >
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...
 

Protected Member Functions

void Reset ()
 Clear all our variables. More...
 
- Protected Member Functions inherited from PlatformerPro.GroundMovement
virtual void SnapToGround ()
 Snaps the character to the ground. More...
 

Protected Attributes

int step
 The current step. More...
 
bool isClimbing
 Are we climbing. More...
 
bool isDescending
 Are we descending. More...
 
Animator myAnimator
 Reference to the animator we use to determine when stiar movements have finished. More...
 
Stairs currentStairs
 Current stair case. More...
 
int facingDirection
 The facing direction. More...
 
bool dismountDown
 Are we dismounting the bootm of steps? More...
 
bool dismountUp
 Are we dismounting the top of the steps? More...
 
bool switchDirection
 Did we just change direction. More...
 
- Protected Attributes inherited from PlatformerPro.BaseMovement< GroundMovement >
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...
 

Properties

new static MovementInfo Info [get]
 Static movement info used by the editor. More...
 
override bool ShouldApplyGravity [get]
 Gets a value indicating whether this PlatformerPro.Movement expects gravity to be applied after its movement finishes. In this case false, Stairs ignore gravity. More...
 
override RaycastType ShouldDoBaseCollisions [get]
 Gets a value indicating whether this PlatformerPro.Movement expects the base collisions to be executed after its movement finishes. In this case NONE. 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. More...
 
- Properties inherited from PlatformerPro.GroundMovement
new static MovementInfo Info [get]
 Static movement info used by the editor. More...
 
virtual bool SupportsSlidingOnSlopes [get]
 Gets a value indicating whether this PlatformerPro.Movement can support automatic sliding based on the characters slope. More...
 
- Properties inherited from PlatformerPro.BaseMovement< GroundMovement >
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

Ground movement for walking up and down stairs.

Member Function Documentation

◆ DoMove()

override void PlatformerPro.GroundMovement_Stairs.DoMove ( )

Moves the character.

◆ GainControl()

override void PlatformerPro.GroundMovement_Stairs.GainControl ( )

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

◆ Init()

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

Initialise the movement with the given movement data (movemnt data is ignored as its not used by this movement).

Parameters
characterCharacter.
movementDataMovement data.

◆ IsGrounded()

override bool PlatformerPro.GroundMovement_Stairs.IsGrounded ( )

Always grounded when on a step.

Returns
true

false

◆ LosingControl()

override void PlatformerPro.GroundMovement_Stairs.LosingControl ( )

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

◆ Reset()

void PlatformerPro.GroundMovement_Stairs.Reset ( )
protected

Clear all our variables.

◆ WantsGroundControl()

override bool PlatformerPro.GroundMovement_Stairs.WantsGroundControl ( )
virtual

Gets a value indicating whether this movement wants to control the movement on the ground. Default is false, with control falling back to default ground. Override if you want particular control.

true if this instance wants control; otherwise, false.

Reimplemented from PlatformerPro.GroundMovement.

Member Data Documentation

◆ currentStairs

Stairs PlatformerPro.GroundMovement_Stairs.currentStairs
protected

Current stair case.

◆ dismountDown

bool PlatformerPro.GroundMovement_Stairs.dismountDown
protected

Are we dismounting the bootm of steps?

◆ dismountUp

bool PlatformerPro.GroundMovement_Stairs.dismountUp
protected

Are we dismounting the top of the steps?

◆ facingDirection

int PlatformerPro.GroundMovement_Stairs.facingDirection
protected

The facing direction.

◆ isClimbing

bool PlatformerPro.GroundMovement_Stairs.isClimbing
protected

Are we climbing.

◆ isDescending

bool PlatformerPro.GroundMovement_Stairs.isDescending
protected

Are we descending.

◆ myAnimator

Animator PlatformerPro.GroundMovement_Stairs.myAnimator
protected

Reference to the animator we use to determine when stiar movements have finished.

◆ step

int PlatformerPro.GroundMovement_Stairs.step
protected

The current step.

◆ switchDirection

bool PlatformerPro.GroundMovement_Stairs.switchDirection
protected

Did we just change direction.

Property Documentation

◆ AnimationState

override AnimationState PlatformerPro.GroundMovement_Stairs.AnimationState
get

Gets the animation state that this movement wants to set.

The state of the animation.

◆ FacingDirection

override int PlatformerPro.GroundMovement_Stairs.FacingDirection
get

Returns the direction the character is facing. 0 for none, 1 for right, -1 for left.

◆ Info

new static MovementInfo PlatformerPro.GroundMovement_Stairs.Info
staticget

Static movement info used by the editor.

◆ ShouldApplyGravity

override bool PlatformerPro.GroundMovement_Stairs.ShouldApplyGravity
get

Gets a value indicating whether this PlatformerPro.Movement expects gravity to be applied after its movement finishes. In this case false, Stairs ignore gravity.

◆ ShouldDoBaseCollisions

override RaycastType PlatformerPro.GroundMovement_Stairs.ShouldDoBaseCollisions
get

Gets a value indicating whether this PlatformerPro.Movement expects the base collisions to be executed after its movement finishes. In this case NONE.


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