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

An air movement with no changing direciton in the air. More...

Inheritance diagram for PlatformerPro.AirMovement_DigitalNoDirChange:
PlatformerPro.AirMovement PlatformerPro.BaseMovement< AirMovement >

Public Member Functions

override bool WantsJump ()
 Gets a value indicating whether this movement wants to intiate the jump. More...
 
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 ForceMaintainControl ()
 If the jump just started force 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. Reset the jump count. More...
 
override void DoJump ()
 Do the jump by translating and applying velocity. More...
 
override void DoOverridenJump (float newHeight, int newJumpCount, bool skipPowerUps=false)
 Do the jump with overriden height and jumpCount. More...
 
- Public Member Functions inherited from PlatformerPro.AirMovement
virtual bool WantsAirControl ()
 Gets a value indicating whether this movement wants to control the movement in the air. Default is false with movement falling back to default air. Override if you want control. More...
 
virtual void DoOverridenMove (bool moveInX, bool moveInY, float xInput, ButtonState runButton)
 Partially moves the character. A lot of movements (e.g. wall movements) require partial air movement. This allows them to use the air movement instead of re-implementing the movement. More...
 
virtual float GetSpeed (float baseSpeed)
 Gets the air speed. More...
 
virtual float GetRunSpeed (float baseRunSpeed)
 Gets the run speed. More...
 
virtual float GetAcceleration (float baseAcceleration)
 Gets the acceleration. More...
 
virtual float GetJumpHeightOrForce (float baseHeight)
 Gets the jump height or the jump force. More...
 
virtual float GetDoubleJumpHeightOrForce (float baseHeight)
 Gets the double jump height or the double jump force. More...
 
- Public Member Functions inherited from PlatformerPro.BaseMovement< AirMovement >
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 airSpeed
 The (horizontal) speed the character moves at in the air. More...
 
float jumpHeight
 How high the character jumps. More...
 
float relativeJumpGravity
 The gravity applied during jump (relative to the characters Gravity component). More...
 
float groundedLeeway
 After the user leaves the ground how much additional time do we give the user to press jump and still consider them grounded. More...
 
float standingJumpDelay
 How long after pressing jump before jump occurs (only applied when standing still). More...
 

Protected Member Functions

override void MoveInX (float horizontalAxis, int horizontalAxisDigital, ButtonState runButton)
 Does the X movement. More...
 
override void MoveInY ()
 Do the Y movement. More...
 
virtual IEnumerator DelayedJump ()
 Does a jump after a delay. Used to play a jump animation before jumping. More...
 
- Protected Member Functions inherited from PlatformerPro.AirMovement
virtual void AddGravityFlipHandler ()
 Add handler for the gravity flip event More...
 
virtual void HandleGravityFlipped (object sender, System.EventArgs e)
 Handles the gravity being flipped. More...
 

Protected Attributes

float initialVelocity
 Derived initial velocity based on jumpHeight and relativeGravity. More...
 
float readyToJumpTimer
 Character can only jump if this timer is less than zero. More...
 
bool jumpStart
 True before the jump leaves the ground. More...
 
bool showJumpStartedAnimation
 Ensure we play the jump start animation. More...
 
bool jumpWhenButtonHeld
 Automatically jump when the character holds the jump button down. More...
 
int jumpCount
 Jump count, set to 0 while not jumping, 1 while jumping. More...
 
int initialJumpDirection
 Direction this jump started in. More...
 
float expectedJumpPeak
 Where we expect the jump to peak. More...
 
- Protected Attributes inherited from PlatformerPro.AirMovement
FlippableGravity flippableGravity
 Cached reference to a flippable gravity. More...
 
- Protected Attributes inherited from PlatformerPro.BaseMovement< AirMovement >
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 float DefaultAirSpeed = 5.0f
 The default air speed. More...
 
const float DefaultJumpHeight = 2.0f
 The default height of the jump. More...
 
const float DefaultRelativeJumpGravity = 1.0f
 The default relative jump gravity. More...
 
const float DefaultGroundedLeeway = 0.1f
 The default grounded leeway. More...
 
const float DefaultStandingJumpDelay = 0.0f
 The default standing jump delay. More...
 
const int AirSpeedIndex = 0
 The index for the air speed value in the movement data. More...
 
const int JumpHeightIndex = 1
 The index for the air speed value in the movement data. More...
 
const int ShowJumpDetailsIndex = 2
 The index for the value of show jumped details. Only used by editor. More...
 
const int JumpRelativeGravityIndex = 3
 The index for the relative jump gravity in the movement data. More...
 
const int GroundedLeewayIndex = 4
 The index for the ground leeway in the movement data. More...
 
const int JumpWhenButtonHeldIndex = 5
 The index for the Jump When Button Held in the movement data. More...
 
const int StandingJumpDelayIndex = 6
 The index for the Stanindg Jump Delay in the movement data. More...
 
const int MovementVariableCount = 7
 The size of the movement variable array. More...
 

Properties

new static MovementInfo Info [get]
 Static movement info used by the editor. More...
 
override bool ShouldApplyGravity [get]
 This class will handle gravity internally. More...
 
override float CurrentGravity [get]
 Gets a value indicating the current gravity, only used if this movement doesn't apply the default gravity.

See also
ShouldApplyGravity()
More...
 
override AnimationState AnimationState [get]
 Gets the animation state that this movement wants to set. More...
 
override int AnimationPriority [get]
 Gets the priority for the animation state. 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 initial jump direction. More...
 
- Properties inherited from PlatformerPro.AirMovement
new static MovementInfo Info [get]
 Static movement info used by the editor. More...
 
- Properties inherited from PlatformerPro.BaseMovement< AirMovement >
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

An air movement with no changing direciton in the air.

Member Function Documentation

◆ DelayedJump()

virtual IEnumerator PlatformerPro.AirMovement_DigitalNoDirChange.DelayedJump ( )
protectedvirtual

Does a jump after a delay. Used to play a jump animation before jumping.

Returns
The jump.

◆ DoJump()

override void PlatformerPro.AirMovement_DigitalNoDirChange.DoJump ( )
virtual

Do the jump by translating and applying velocity.

Reimplemented from PlatformerPro.AirMovement.

◆ DoMove()

override void PlatformerPro.AirMovement_DigitalNoDirChange.DoMove ( )

Moves the character.

◆ DoOverridenJump()

override void PlatformerPro.AirMovement_DigitalNoDirChange.DoOverridenJump ( float  newHeight,
int  newJumpCount,
bool  skipPowerUps = false 
)
virtual

Do the jump with overriden height and jumpCount.

Reimplemented from PlatformerPro.AirMovement.

◆ ForceMaintainControl()

override bool PlatformerPro.AirMovement_DigitalNoDirChange.ForceMaintainControl ( )

If the jump just started force control.

◆ GainControl()

override void PlatformerPro.AirMovement_DigitalNoDirChange.GainControl ( )

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

◆ Init()

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

Initialise the movement with the given movement data.

Parameters
characterCharacter.
movementDataMovement data.

◆ LosingControl()

override void PlatformerPro.AirMovement_DigitalNoDirChange.LosingControl ( )

Called when the movement loses control. Reset the jump count.

◆ MoveInX()

override void PlatformerPro.AirMovement_DigitalNoDirChange.MoveInX ( float  horizontalAxis,
int  horizontalAxisDigital,
ButtonState  runButton 
)
protectedvirtual

Does the X movement.

Reimplemented from PlatformerPro.AirMovement.

◆ MoveInY()

override void PlatformerPro.AirMovement_DigitalNoDirChange.MoveInY ( )
protectedvirtual

Do the Y movement.

Reimplemented from PlatformerPro.AirMovement.

◆ WantsJump()

override bool PlatformerPro.AirMovement_DigitalNoDirChange.WantsJump ( )
virtual

Gets a value indicating whether this movement wants to intiate the jump.

true if this instance should jump; otherwise, false.

Reimplemented from PlatformerPro.AirMovement.

Member Data Documentation

◆ airSpeed

float PlatformerPro.AirMovement_DigitalNoDirChange.airSpeed

The (horizontal) speed the character moves at in the air.

◆ AirSpeedIndex

const int PlatformerPro.AirMovement_DigitalNoDirChange.AirSpeedIndex = 0
staticprotected

The index for the air speed value in the movement data.

◆ DefaultAirSpeed

const float PlatformerPro.AirMovement_DigitalNoDirChange.DefaultAirSpeed = 5.0f
staticprotected

The default air speed.

◆ DefaultGroundedLeeway

const float PlatformerPro.AirMovement_DigitalNoDirChange.DefaultGroundedLeeway = 0.1f
staticprotected

The default grounded leeway.

◆ DefaultJumpHeight

const float PlatformerPro.AirMovement_DigitalNoDirChange.DefaultJumpHeight = 2.0f
staticprotected

The default height of the jump.

◆ DefaultRelativeJumpGravity

const float PlatformerPro.AirMovement_DigitalNoDirChange.DefaultRelativeJumpGravity = 1.0f
staticprotected

The default relative jump gravity.

◆ DefaultStandingJumpDelay

const float PlatformerPro.AirMovement_DigitalNoDirChange.DefaultStandingJumpDelay = 0.0f
staticprotected

The default standing jump delay.

◆ expectedJumpPeak

float PlatformerPro.AirMovement_DigitalNoDirChange.expectedJumpPeak
protected

Where we expect the jump to peak.

◆ groundedLeeway

float PlatformerPro.AirMovement_DigitalNoDirChange.groundedLeeway

After the user leaves the ground how much additional time do we give the user to press jump and still consider them grounded.

◆ GroundedLeewayIndex

const int PlatformerPro.AirMovement_DigitalNoDirChange.GroundedLeewayIndex = 4
staticprotected

The index for the ground leeway in the movement data.

◆ initialJumpDirection

int PlatformerPro.AirMovement_DigitalNoDirChange.initialJumpDirection
protected

Direction this jump started in.

◆ initialVelocity

float PlatformerPro.AirMovement_DigitalNoDirChange.initialVelocity
protected

Derived initial velocity based on jumpHeight and relativeGravity.

◆ jumpCount

int PlatformerPro.AirMovement_DigitalNoDirChange.jumpCount
protected

Jump count, set to 0 while not jumping, 1 while jumping.

◆ jumpHeight

float PlatformerPro.AirMovement_DigitalNoDirChange.jumpHeight

How high the character jumps.

◆ JumpHeightIndex

const int PlatformerPro.AirMovement_DigitalNoDirChange.JumpHeightIndex = 1
staticprotected

The index for the air speed value in the movement data.

◆ JumpRelativeGravityIndex

const int PlatformerPro.AirMovement_DigitalNoDirChange.JumpRelativeGravityIndex = 3
staticprotected

The index for the relative jump gravity in the movement data.

◆ jumpStart

bool PlatformerPro.AirMovement_DigitalNoDirChange.jumpStart
protected

True before the jump leaves the ground.

◆ jumpWhenButtonHeld

bool PlatformerPro.AirMovement_DigitalNoDirChange.jumpWhenButtonHeld
protected

Automatically jump when the character holds the jump button down.

◆ JumpWhenButtonHeldIndex

const int PlatformerPro.AirMovement_DigitalNoDirChange.JumpWhenButtonHeldIndex = 5
staticprotected

The index for the Jump When Button Held in the movement data.

◆ MovementVariableCount

const int PlatformerPro.AirMovement_DigitalNoDirChange.MovementVariableCount = 7
staticprotected

The size of the movement variable array.

◆ readyToJumpTimer

float PlatformerPro.AirMovement_DigitalNoDirChange.readyToJumpTimer
protected

Character can only jump if this timer is less than zero.

◆ relativeJumpGravity

float PlatformerPro.AirMovement_DigitalNoDirChange.relativeJumpGravity

The gravity applied during jump (relative to the characters Gravity component).

◆ ShowJumpDetailsIndex

const int PlatformerPro.AirMovement_DigitalNoDirChange.ShowJumpDetailsIndex = 2
staticprotected

The index for the value of show jumped details. Only used by editor.

◆ showJumpStartedAnimation

bool PlatformerPro.AirMovement_DigitalNoDirChange.showJumpStartedAnimation
protected

Ensure we play the jump start animation.

◆ standingJumpDelay

float PlatformerPro.AirMovement_DigitalNoDirChange.standingJumpDelay

How long after pressing jump before jump occurs (only applied when standing still).

◆ StandingJumpDelayIndex

const int PlatformerPro.AirMovement_DigitalNoDirChange.StandingJumpDelayIndex = 6
staticprotected

The index for the Stanindg Jump Delay in the movement data.

Property Documentation

◆ AnimationPriority

override int PlatformerPro.AirMovement_DigitalNoDirChange.AnimationPriority
get

Gets the priority for the animation state.

◆ AnimationState

override AnimationState PlatformerPro.AirMovement_DigitalNoDirChange.AnimationState
get

Gets the animation state that this movement wants to set.

◆ CurrentGravity

override float PlatformerPro.AirMovement_DigitalNoDirChange.CurrentGravity
get

Gets a value indicating the current gravity, only used if this movement doesn't apply the default gravity.

See also
ShouldApplyGravity()

◆ FacingDirection

override int PlatformerPro.AirMovement_DigitalNoDirChange.FacingDirection
get

Returns the direction the character is facing. 0 for none, 1 for right, -1 for left. This overriden version always returns the initial jump direction.

◆ Info

new static MovementInfo PlatformerPro.AirMovement_DigitalNoDirChange.Info
staticget

Static movement info used by the editor.

◆ ShouldApplyGravity

override bool PlatformerPro.AirMovement_DigitalNoDirChange.ShouldApplyGravity
get

This class will handle gravity internally.


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