![]() |
Platformer Pro
2.3.2
A platform game kit for Unity.
|
Physics based air movement. More...
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 mvoement 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 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 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... | |
![]() | |
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 | jumpVelocity |
The velocity applied in y when the character jumps. More... | |
float | acceleration |
The speed the character accelerates at in x . More... | |
float | maxSpeed |
The maximum speed the character can accelerate to in x. Note they can go faster than this if they do a running and jump and don't change direction. More... | |
float | drag |
The air drag. More... | |
bool | useAnalogueInput |
If true the acceleration will be multiplied via the analogue input value. More... | |
float | jumpGroundedLeeway |
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 | ignoreForce |
Forces smaller than this will be ignored (generally applies to very small input values). More... | |
bool | canDoubleJump |
Can the character double jump. More... | |
float | doubleJumpVelocity |
The velocity applied in y when the character double jumps. More... | |
bool | jumpAway |
Should we jump away from the current angle, or just jump up? More... | |
int | maxDoubleJumpCount |
How many times the character can double jump. -1 means infinite. More... | |
Protected Member Functions | |
override void | MoveInX (float horizontalAxis, int horizontalAxisDigital, ButtonState runButton) |
Do the X movement. More... | |
override void | MoveInY () |
Do the Y movement. More... | |
virtual void | DoRotation () |
Rotate towards the target rotation. 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 | |
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 | hasRecievedCounterInput |
If a user keeps holding in the direction they jumped, they will jump further. If they stop doing so they can no longer move faster than max speed. More... | |
int | initialDirection |
The direction the character was moving when they started the jump. More... | |
int | jumpCount |
Jump count, set to 0 while not jumping, 1 while jumping, 2 while double More... | |
bool | jumpWhenButtonHeld |
Automatically jump when the character holds the jump button down. 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 | |
const int | AccelerationIndex = 0 |
The index for the acceleration value in the movement data. More... | |
const int | MaxSpeedIndex = 1 |
The index for the max speed value in the movement data. More... | |
const int | DragIndex = 2 |
The index for the drag index value in the movement data. More... | |
const int | UseAnalogueIndex = 3 |
The index for use analgoue input in the movement data. More... | |
const int | GroundedLeewayIndex = 4 |
The index for the ground leeay in the movement data. More... | |
const int | IgnoreForceIndex = 5 |
The index for the ignore force value in the movement data. More... | |
const int | JumpVelocityIndex = 6 |
The index for the jump velocity value in the movement data. More... | |
const int | CanDoubleJumpIndex = 7 |
The index for can double jump in the movement data. More... | |
const int | DoubleJumpVelocityIndex = 8 |
The index for the double jump velocity in the movement data. More... | |
const int | JumpWhenButtonHeldIndex = 9 |
The index for the Jump When Button Held in the movement data. More... | |
const int | JumpAwayIndex = 10 |
The index for the Jump Away setting in the movement data. More... | |
const int | MaxDoubleJumpCountIndex = 11 |
The index for the Max Double Jump Count in the movement data. More... | |
const int | MovementVariableCount = 12 |
The size of the movement variable array. More... | |
const float | DefaultJumpVelocity = 10.0f |
The default jump velocity. More... | |
const float | DefaultAcceleration = 60.0f |
The default acceleration. More... | |
const float | DefaultDoubleJumpVelocity = 7.0f |
The default double jump velocity. More... | |
const float | DefaultMaxSpeed = 7.0f |
The default max speed. More... | |
const float | DefaultDrag = 5.0f |
The default drag. More... | |
Properties | |
new static MovementInfo | Info [get] |
Static movement info used by the editor. 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... | |
override VelocityType | VelocityType [get] |
How does this movement use Velocity. More... | |
override bool | ShouldDoRotations [get] |
Gets a value indicating whether this PlatformerPro.Movement expects the rotations to be calculated and applied by the character. More... | |
override bool | ShouldApplyGravity [get] |
This class will handle gravity internally. 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... | |
Physics based air movement.
|
virtual |
Do the jump by translating and applying velocity.
Reimplemented from PlatformerPro.AirMovement.
override void PlatformerPro.AirMovement_Physics.DoMove | ( | ) |
Moves the character.
|
virtual |
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.
newHeight | New height. |
jumpCount | Jump count. |
Reimplemented from PlatformerPro.AirMovement.
|
protectedvirtual |
Rotate towards the target rotation.
override bool PlatformerPro.AirMovement_Physics.ForceMaintainControl | ( | ) |
If the jump just started force control.
override void PlatformerPro.AirMovement_Physics.GainControl | ( | ) |
Called when the movement gets control. Typically used to do initialisation of velocity and the like.
override Movement PlatformerPro.AirMovement_Physics.Init | ( | Character | character, |
MovementVariable[] | movementData | ||
) |
Initialise the mvoement with the given movement data.
character | character. |
movementData | Movement data. |
override void PlatformerPro.AirMovement_Physics.LosingControl | ( | ) |
Called when the movement loses control. Reset the jump count.
|
protectedvirtual |
Do 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 intiate the jump.
true
if this instance should jump; otherwise, false
.
Reimplemented from PlatformerPro.AirMovement.
float PlatformerPro.AirMovement_Physics.acceleration |
The speed the character accelerates at in x .
|
staticprotected |
The index for the acceleration value in the movement data.
bool PlatformerPro.AirMovement_Physics.canDoubleJump |
Can the character double jump.
|
staticprotected |
The index for can double jump in the movement data.
|
staticprotected |
The default acceleration.
|
staticprotected |
The default double jump velocity.
|
staticprotected |
The default drag.
|
staticprotected |
The default jump velocity.
|
staticprotected |
The default max speed.
float PlatformerPro.AirMovement_Physics.doubleJumpVelocity |
The velocity applied in y when the character double jumps.
|
staticprotected |
The index for the double jump velocity in the movement data.
float PlatformerPro.AirMovement_Physics.drag |
The air drag.
|
staticprotected |
The index for the drag index value in the movement data.
|
staticprotected |
The index for the ground leeay in the movement data.
|
protected |
If a user keeps holding in the direction they jumped, they will jump further. If they stop doing so they can no longer move faster than max speed.
float PlatformerPro.AirMovement_Physics.ignoreForce |
Forces smaller than this will be ignored (generally applies to very small input values).
|
staticprotected |
The index for the ignore force value in the movement data.
|
protected |
The direction the character was moving when they started the jump.
bool PlatformerPro.AirMovement_Physics.jumpAway |
Should we jump away from the current angle, or just jump up?
|
staticprotected |
The index for the Jump Away setting in the movement data.
|
protected |
Jump count, set to 0 while not jumping, 1 while jumping, 2 while double
float PlatformerPro.AirMovement_Physics.jumpGroundedLeeway |
After the user leaves the ground how much additional time do we give the user to press jump and still consider them grounded.
|
protected |
True before the jump leaves the ground.
float PlatformerPro.AirMovement_Physics.jumpVelocity |
The velocity applied in y when the character jumps.
|
staticprotected |
The index for the jump velocity value in the movement data.
|
protected |
Automatically jump when the character holds the jump button down.
|
staticprotected |
The index for the Jump When Button Held in the movement data.
int PlatformerPro.AirMovement_Physics.maxDoubleJumpCount |
How many times the character can double jump. -1 means infinite.
|
staticprotected |
The index for the Max Double Jump Count in the movement data.
float PlatformerPro.AirMovement_Physics.maxSpeed |
The maximum speed the character can accelerate to in x. Note they can go faster than this if they do a running and jump and don't change direction.
|
staticprotected |
The index for the max speed value in the movement data.
|
staticprotected |
The size of the movement variable array.
|
protected |
Character can only jump if this timer is less than zero.
|
protected |
Ensure we play the jump start animation.
|
staticprotected |
The index for use analgoue input in the movement data.
bool PlatformerPro.AirMovement_Physics.useAnalogueInput |
If true the acceleration will be multiplied via the analogue input value.
|
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.
|
get |
Gets a value indicating whether this PlatformerPro.Movement expects the rotations to be calculated and applied by the character.
|
get |
How does this movement use Velocity.