![]() |
Platformer Pro
2.3.2
A platform game kit for Unity.
|
Air movement which allows you teleport multiple times in any direction. Note that you still move through space when teleporting More...
Public Member Functions | |
override Movement | Init (Character character, MovementVariable[] movementData) |
Initialise the movement with the given movement data. More... | |
override bool | WantsJump () |
Gets a value indicating whether this movement wants to intitiate 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 | DoJump () |
Do the jump. More... | |
override void | DoMove () |
Moves the character. 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. Override to do any reset type actions. 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... | |
![]() | |
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 | warpSpeed |
How fast the character dashes. More... | |
float | warpDistance |
How fast the character dashes. More... | |
bool | isInvincible |
Are we invincible when teleporting? More... | |
int | maxWarpCount |
How many times can we teleport. More... | |
float | timeToNextWarp |
How quickly does the user have to trigger the next warp if they want to multiwarp. 0 means no time limit. More... | |
TeleportJumpControlType | controlType |
How do we control the jump. More... | |
int | actionButton |
Action button to use if control type is ACTION_BUTTON_AND_DIRECTION. More... | |
Protected Member Functions | |
virtual void | OnStartTeleport () |
Raises the start teleport event. More... | |
virtual void | OnEndTeleport () |
Raises the end teleport event. More... | |
virtual void | OnInterruptTeleport () |
Raises the interrupt teleport event. More... | |
virtual bool | CheckForCancel () |
Checks if we hit something More... | |
virtual bool | CheckInput () |
Check if user has entered jump input. More... | |
virtual Vector2 | GetAimDirection () |
![]() | |
virtual void | MoveInX (float horizontalAxis, int horizontalAxisDigital, ButtonState runButton) |
Moves in x. More... | |
virtual void | MoveInY () |
Moves in y. 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 | |
Vector2 | teleportVelocity |
Vector 2 representing direction and speed of travel. More... | |
bool | isWarping |
True when we are currently warping. More... | |
int | warpCount |
Current warp count, only reset when grounded or on to wall. More... | |
float | distanceTravelled |
How far have we travelled in the current warp. More... | |
float | warpTimer |
How long to next warp. More... | |
CharacterHealth | characterHealth |
Cached character health. More... | |
CharacterEventArgs | eventArgs |
Cached event args. 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 float | DefaulWarpSpeed = 10.0f |
The default speed. More... | |
static float | DefaultWarpDistance = 3.0f |
The default distance. More... | |
const int | WarpSpeedIndex = 0 |
The index of the speed in the movement data. More... | |
const int | WarpDistanceIndex = 1 |
The index of the distance in the movement data. More... | |
const int | IsInvincibleIndex = 2 |
The index of the is invincible setting in the movement data. More... | |
const int | MaxWarpsIndex = 3 |
The index of the max warp count in the movement Data More... | |
const int | ControlTypeIndex = 4 |
The index of the control type in the movement Data More... | |
const int | ActionButtonindex = 5 |
The index of the action button in the movement Data More... | |
const int | TimeToNextWarpIndex = 6 |
The index of the time to next warp 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] |
Gets a value indicating whether this PlatformerPro.Movement expects gravity to be applied after its movement finishes. More... | |
override AnimationState | AnimationState [get] |
Gets the animation state that this movement wants to set. More... | |
float | WarpTimeRemaining [get] |
Gets the remainig warp time. More... | |
float | WarpTimeRemainingAsPercentage [get] |
Gets the remainig warp time as percentage bweten 0 and 1 (e.g. for fill bar). 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... | |
Events | |
System.EventHandler< CharacterEventArgs > | StartTeleport |
Event for start teleport. More... | |
System.EventHandler< CharacterEventArgs > | EndTeleport |
Event for stop teleport. More... | |
System.EventHandler< CharacterEventArgs > | InterruptTeleport |
Event for interrupt teleport. More... | |
Air movement which allows you teleport multiple times in any direction. Note that you still move through space when teleporting
|
protectedvirtual |
Checks if we hit something
true
if we hit something and should cancel the attack, false
otherwise.
|
protectedvirtual |
Check if user has entered jump input.
true
, if input was checked, false
otherwise.
|
virtual |
Do the jump.
Reimplemented from PlatformerPro.AirMovement.
override void PlatformerPro.AirMovement_TeleportJump.DoMove | ( | ) |
Moves the character.
override void PlatformerPro.AirMovement_TeleportJump.GainControl | ( | ) |
Called when the movement gets control. Typically used to do initialisation of velocity and the like.
true
, if control was gained, false
otherwise.
|
protectedvirtual |
override Movement PlatformerPro.AirMovement_TeleportJump.Init | ( | Character | character, |
MovementVariable[] | movementData | ||
) |
override void PlatformerPro.AirMovement_TeleportJump.LosingControl | ( | ) |
Called when the movement loses control. Override to do any reset type actions.
|
protectedvirtual |
Raises the end teleport event.
|
protectedvirtual |
Raises the interrupt teleport event.
|
protectedvirtual |
Raises the start teleport event.
|
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
Reimplemented from PlatformerPro.AirMovement.
|
virtual |
Gets a value indicating whether this movement wants to intitiate the jump.
true
false
Reimplemented from PlatformerPro.AirMovement.
int PlatformerPro.AirMovement_TeleportJump.actionButton |
Action button to use if control type is ACTION_BUTTON_AND_DIRECTION.
|
staticprotected |
The index of the action button in the movement Data
|
protected |
Cached character health.
TeleportJumpControlType PlatformerPro.AirMovement_TeleportJump.controlType |
How do we control the jump.
|
staticprotected |
The index of the control type in the movement Data
|
staticprotected |
The default distance.
|
staticprotected |
The default speed.
|
protected |
How far have we travelled in the current warp.
|
protected |
Cached event args.
bool PlatformerPro.AirMovement_TeleportJump.isInvincible |
Are we invincible when teleporting?
|
staticprotected |
The index of the is invincible setting in the movement data.
|
protected |
True when we are currently warping.
int PlatformerPro.AirMovement_TeleportJump.maxWarpCount |
How many times can we teleport.
|
staticprotected |
The index of the max warp count in the movement Data
|
staticprotected |
The size of the movement variable array.
|
protected |
Vector 2 representing direction and speed of travel.
float PlatformerPro.AirMovement_TeleportJump.timeToNextWarp |
How quickly does the user have to trigger the next warp if they want to multiwarp. 0 means no time limit.
|
staticprotected |
The index of the time to next warp in the movement data.
|
protected |
Current warp count, only reset when grounded or on to wall.
float PlatformerPro.AirMovement_TeleportJump.warpDistance |
How fast the character dashes.
|
staticprotected |
The index of the distance in the movement data.
float PlatformerPro.AirMovement_TeleportJump.warpSpeed |
How fast the character dashes.
|
staticprotected |
The index of the speed in the movement data.
|
protected |
How long to next warp.
|
get |
Gets the animation state that this movement wants to set.
The state of the animation.
|
staticget |
Static movement info used by the editor.
|
get |
Gets a value indicating whether this PlatformerPro.Movement expects gravity to be applied after its movement finishes.
|
get |
Gets the remainig warp time.
|
get |
Gets the remainig warp time as percentage bweten 0 and 1 (e.g. for fill bar).
System.EventHandler<CharacterEventArgs> PlatformerPro.AirMovement_TeleportJump.EndTeleport |
Event for stop teleport.
System.EventHandler<CharacterEventArgs> PlatformerPro.AirMovement_TeleportJump.InterruptTeleport |
Event for interrupt teleport.
System.EventHandler<CharacterEventArgs> PlatformerPro.AirMovement_TeleportJump.StartTeleport |
Event for start teleport.