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

Air movement which allows flying. More...

Inheritance diagram for PlatformerPro.AirMovement_Fly:
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 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 ()
 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 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 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

Vector2 maxAirSpeed
 The max speed the character moves in the air. More...
 
Vector2 airAcceleration
 Acceleration in X and Y. More...
 
Vector2 airDrag
 Air drag in x and y (controls how quickly you stop). More...
 
string item
 If non null/empty this is the item required to fly. More...
 
int itemConsumptionRate
 If item is present and this is bigger than zero then the item will be consumed like fule or energy. 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 bool CheckItems ()
 Check that the required items is present. 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

ItemManager itemManager
 Cached copy of the item manager if this jet pack requires fuel. More...
 
float subIntFuelUsage
 We still want to use fuel even if we use less than 1 fuel per frame. This is where we track it. 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

static Vector2 DefaultMaxAirSpeed = new Vector2(4, 3)
 The default max air speed. More...
 
static Vector2 DefaultAirAcceleration = new Vector2(40, 40)
 The default air accelration. More...
 
static Vector2 DefaultAirDrag = new Vector2(10, 10)
 The default air drag. More...
 
const int MaxAirSpeedIndex = 0
 The index of the max air speed in the movement data. More...
 
const int AirAccelerationIndex = 1
 The index of the air acceleration in the movement data. More...
 
const int AirDragIndex = 2
 The index of the air drag in the movement data. More...
 
const int ItemIndex = 3
 The index of the item in the movement Data More...
 
const int ItemConsumptionRateIndex = 4
 The index of the item consumption rate in the movement Data. 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 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 input 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

Air movement which allows flying.

Member Function Documentation

◆ CheckItems()

virtual bool PlatformerPro.AirMovement_Fly.CheckItems ( )
protectedvirtual

Check that the required items is present.

Returns
true, if items was checked, false otherwise.

◆ DoJump()

override void PlatformerPro.AirMovement_Fly.DoJump ( )
virtual

Do the jump by translating and applying velocity.

Reimplemented from PlatformerPro.AirMovement.

◆ DoMove()

override void PlatformerPro.AirMovement_Fly.DoMove ( )

Moves the character.

◆ DoOverridenJump()

override void PlatformerPro.AirMovement_Fly.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_Fly.ForceMaintainControl ( )

If the jump just started force control.

◆ Init()

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

Initialise the movement with the given movement data.

Parameters
characterCharacter.
movementDataMovement data.

◆ LosingControl()

override void PlatformerPro.AirMovement_Fly.LosingControl ( )

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

◆ MoveInX()

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

Does the X movement.

Reimplemented from PlatformerPro.AirMovement.

◆ MoveInY()

override void PlatformerPro.AirMovement_Fly.MoveInY ( )
protectedvirtual

Do the Y movement.

Reimplemented from PlatformerPro.AirMovement.

◆ WantsAirControl()

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

◆ WantsJump()

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

◆ airAcceleration

Vector2 PlatformerPro.AirMovement_Fly.airAcceleration

Acceleration in X and Y.

◆ AirAccelerationIndex

const int PlatformerPro.AirMovement_Fly.AirAccelerationIndex = 1
staticprotected

The index of the air acceleration in the movement data.

◆ airDrag

Vector2 PlatformerPro.AirMovement_Fly.airDrag

Air drag in x and y (controls how quickly you stop).

◆ AirDragIndex

const int PlatformerPro.AirMovement_Fly.AirDragIndex = 2
staticprotected

The index of the air drag in the movement data.

◆ DefaultAirAcceleration

Vector2 PlatformerPro.AirMovement_Fly.DefaultAirAcceleration = new Vector2(40, 40)
staticprotected

The default air accelration.

◆ DefaultAirDrag

Vector2 PlatformerPro.AirMovement_Fly.DefaultAirDrag = new Vector2(10, 10)
staticprotected

The default air drag.

◆ DefaultMaxAirSpeed

Vector2 PlatformerPro.AirMovement_Fly.DefaultMaxAirSpeed = new Vector2(4, 3)
staticprotected

The default max air speed.

◆ item

string PlatformerPro.AirMovement_Fly.item

If non null/empty this is the item required to fly.

◆ itemConsumptionRate

int PlatformerPro.AirMovement_Fly.itemConsumptionRate

If item is present and this is bigger than zero then the item will be consumed like fule or energy.

◆ ItemConsumptionRateIndex

const int PlatformerPro.AirMovement_Fly.ItemConsumptionRateIndex = 4
staticprotected

The index of the item consumption rate in the movement Data.

◆ ItemIndex

const int PlatformerPro.AirMovement_Fly.ItemIndex = 3
staticprotected

The index of the item in the movement Data

◆ itemManager

ItemManager PlatformerPro.AirMovement_Fly.itemManager
protected

Cached copy of the item manager if this jet pack requires fuel.

◆ maxAirSpeed

Vector2 PlatformerPro.AirMovement_Fly.maxAirSpeed

The max speed the character moves in the air.

◆ MaxAirSpeedIndex

const int PlatformerPro.AirMovement_Fly.MaxAirSpeedIndex = 0
staticprotected

The index of the max air speed in the movement data.

◆ MovementVariableCount

const int PlatformerPro.AirMovement_Fly.MovementVariableCount = 5
staticprotected

The size of the movement variable array.

◆ subIntFuelUsage

float PlatformerPro.AirMovement_Fly.subIntFuelUsage
protected

We still want to use fuel even if we use less than 1 fuel per frame. This is where we track it.

Property Documentation

◆ AnimationPriority

override int PlatformerPro.AirMovement_Fly.AnimationPriority
get

Gets the priority for the animation state.

◆ AnimationState

override AnimationState PlatformerPro.AirMovement_Fly.AnimationState
get

Gets the animation state that this movement wants to set.

◆ FacingDirection

override int PlatformerPro.AirMovement_Fly.FacingDirection
get

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

◆ Info

new static MovementInfo PlatformerPro.AirMovement_Fly.Info
staticget

Static movement info used by the editor.

◆ ShouldApplyGravity

override bool PlatformerPro.AirMovement_Fly.ShouldApplyGravity
get

This class will handle gravity internally.


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