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

Air movement which tries to hit a target speed by slowing down or speeding up. Simulates a parachute. More...

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

Public Member Functions

override Movement Init (Character character, MovementVariable[] movementData)
 Initialise the movement with the given movement data. More...
 
override 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...
 
override void DoMove ()
 
- Public Member Functions inherited from PlatformerPro.AirMovement
virtual bool WantsJump ()
 Gets a value indicating whether this movement wants to intiate the jump. More...
 
virtual void DoJump ()
 Do the jump. More...
 
virtual void DoOverridenJump (float newHeight, int jumpCount, bool skipPowerUps=false)
 Does a jump with overriden values for the key variables. Primarily used to allow platforms and wall jumps to affect jump height in non-physics based jumps. 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 targetSpeed
 The target speed. More...
 
float gravity
 The acceleration used to speed up to target speed. More...
 
float deceleration
 The deceleration, used to slow down to target speed if going faster than gravity when parachute is engaged. More...
 
float xSpeed
 How fast we move in x. More...
 
int actionButton
 The action buttion. If its -1 parachute is always engaged. More...
 

Protected Member Functions

override void MoveInX (float horizontalAxis, int horizontalAxisDigital, ButtonState runButton)
 Moves the character. More...
 
override void MoveInY ()
 
- 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

bool jumpStarted
 Track if a normal jump has started. 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 DefaultTargetSpeed = -5.0f
 Default target speed. More...
 
const float DefaultGravity = -5.0f
 The default acceleration. More...
 
const float DefaultDeceleration = 5.0f
 The default decceleration. More...
 
const float DefaultXSpeed = 1.0f
 The default x speed. More...
 
const int TargetSpeedIndex = 0
 The index of the target speed More...
 
const int GravityIndex = 1
 The index of the acceleration. More...
 
const int DecelerationIndex = 2
 The index of the deceleration. More...
 
const int XSpeedIndex = 3
 The index of the x speed. More...
 
const int ActionButtonIndex = 4
 The index of the action button. More...
 
const int MovementVariableCount = 5
 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...
 
- 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

Air movement which tries to hit a target speed by slowing down or speeding up. Simulates a parachute.

Member Function Documentation

◆ DoMove()

override void PlatformerPro.AirMovement_Parachute.DoMove ( )

◆ Init()

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

Initialise the movement with the given movement data.

Parameters
characterCharacter.
movementDataMovement data.

◆ MoveInX()

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

Moves the character.

Reimplemented from PlatformerPro.AirMovement.

◆ MoveInY()

override void PlatformerPro.AirMovement_Parachute.MoveInY ( )
protectedvirtual

Do the Y movement.

Reimplemented from PlatformerPro.AirMovement.

◆ WantsAirControl()

override bool PlatformerPro.AirMovement_Parachute.WantsAirControl ( )
virtual

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.

true

false

Returns
true, if air control was wantsed, false otherwise.

Reimplemented from PlatformerPro.AirMovement.

Member Data Documentation

◆ actionButton

int PlatformerPro.AirMovement_Parachute.actionButton

The action buttion. If its -1 parachute is always engaged.

◆ ActionButtonIndex

const int PlatformerPro.AirMovement_Parachute.ActionButtonIndex = 4
staticprotected

The index of the action button.

◆ deceleration

float PlatformerPro.AirMovement_Parachute.deceleration

The deceleration, used to slow down to target speed if going faster than gravity when parachute is engaged.

◆ DecelerationIndex

const int PlatformerPro.AirMovement_Parachute.DecelerationIndex = 2
staticprotected

The index of the deceleration.

◆ DefaultDeceleration

const float PlatformerPro.AirMovement_Parachute.DefaultDeceleration = 5.0f
staticprotected

The default decceleration.

◆ DefaultGravity

const float PlatformerPro.AirMovement_Parachute.DefaultGravity = -5.0f
staticprotected

The default acceleration.

◆ DefaultTargetSpeed

const float PlatformerPro.AirMovement_Parachute.DefaultTargetSpeed = -5.0f
staticprotected

Default target speed.

◆ DefaultXSpeed

const float PlatformerPro.AirMovement_Parachute.DefaultXSpeed = 1.0f
staticprotected

The default x speed.

◆ gravity

float PlatformerPro.AirMovement_Parachute.gravity

The acceleration used to speed up to target speed.

◆ GravityIndex

const int PlatformerPro.AirMovement_Parachute.GravityIndex = 1
staticprotected

The index of the acceleration.

◆ jumpStarted

bool PlatformerPro.AirMovement_Parachute.jumpStarted
protected

Track if a normal jump has started.

◆ MovementVariableCount

const int PlatformerPro.AirMovement_Parachute.MovementVariableCount = 5
staticprotected

The size of the movement variable array.

◆ targetSpeed

float PlatformerPro.AirMovement_Parachute.targetSpeed

The target speed.

◆ TargetSpeedIndex

const int PlatformerPro.AirMovement_Parachute.TargetSpeedIndex = 0
staticprotected

The index of the target speed

◆ xSpeed

float PlatformerPro.AirMovement_Parachute.xSpeed

How fast we move in x.

◆ XSpeedIndex

const int PlatformerPro.AirMovement_Parachute.XSpeedIndex = 3
staticprotected

The index of the x speed.

Property Documentation

◆ AnimationState

override AnimationState PlatformerPro.AirMovement_Parachute.AnimationState
get

Gets the animation state that this movement wants to set.

◆ CurrentGravity

override float PlatformerPro.AirMovement_Parachute.CurrentGravity
get

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

See also
ShouldApplyGravity()

◆ Info

new static MovementInfo PlatformerPro.AirMovement_Parachute.Info
staticget

Static movement info used by the editor.

◆ ShouldApplyGravity

override bool PlatformerPro.AirMovement_Parachute.ShouldApplyGravity
get

This class will handle gravity internally.


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