![]() |
Platformer Pro
2.3.2
A platform game kit for Unity.
|
Air movement which allows flying. More...
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... | |
![]() | |
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... | |
![]() | |
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... | |
![]() | |
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... | |
![]() | |
FlippableGravity | flippableGravity |
Cached reference to a flippable gravity. More... | |
![]() | |
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... | |
![]() | |
new static MovementInfo | Info [get] |
Static movement info used by the editor. More... | |
![]() | |
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... | |
Air movement which allows flying.
|
protectedvirtual |
Check that the required items is present.
true
, if items was checked, false
otherwise.
|
virtual |
Do the jump by translating and applying velocity.
Reimplemented from PlatformerPro.AirMovement.
override void PlatformerPro.AirMovement_Fly.DoMove | ( | ) |
Moves the character.
|
virtual |
Do the jump with overriden height and jumpCount.
Reimplemented from PlatformerPro.AirMovement.
override bool PlatformerPro.AirMovement_Fly.ForceMaintainControl | ( | ) |
If the jump just started force control.
override Movement PlatformerPro.AirMovement_Fly.Init | ( | Character | character, |
MovementVariable[] | movementData | ||
) |
override void PlatformerPro.AirMovement_Fly.LosingControl | ( | ) |
Called when the movement loses control. Reset the jump count.
|
protectedvirtual |
Does the X movement.
Reimplemented from PlatformerPro.AirMovement.
|
protectedvirtual |
Do the Y movement.
Reimplemented from PlatformerPro.AirMovement.
|
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
true
, if air control was wantsed, false
otherwise.Reimplemented from PlatformerPro.AirMovement.
|
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.
Vector2 PlatformerPro.AirMovement_Fly.airAcceleration |
Acceleration in X and Y.
|
staticprotected |
The index of the air acceleration in the movement data.
Vector2 PlatformerPro.AirMovement_Fly.airDrag |
Air drag in x and y (controls how quickly you stop).
|
staticprotected |
The index of the air drag in the movement data.
|
staticprotected |
The default air accelration.
|
staticprotected |
The default air drag.
|
staticprotected |
The default max air speed.
string PlatformerPro.AirMovement_Fly.item |
If non null/empty this is the item required to fly.
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.
|
staticprotected |
The index of the item consumption rate in the movement Data.
|
staticprotected |
The index of the item in the movement Data
|
protected |
Cached copy of the item manager if this jet pack requires fuel.
Vector2 PlatformerPro.AirMovement_Fly.maxAirSpeed |
The max speed the character moves in the air.
|
staticprotected |
The index of the max air speed in the movement data.
|
staticprotected |
The size of the movement variable array.
|
protected |
We still want to use fuel even if we use less than 1 fuel per frame. This is where we track it.
|
get |
Gets the priority for the animation state.
|
get |
Gets the animation state that this movement wants to set.
|
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.
|
staticget |
Static movement info used by the editor.
|
get |
This class will handle gravity internally.