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

Air movement which allows you teleport multiple times in any direction. Note that you still move through space when teleporting More...

Inheritance diagram for PlatformerPro.AirMovement_TeleportJump:
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 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...
 
- Public Member Functions inherited from PlatformerPro.AirMovement
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 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 ()
 
- Protected Member Functions inherited from PlatformerPro.AirMovement
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...
 
- 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 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...
 
- 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...
 

Events

System.EventHandler< CharacterEventArgsStartTeleport
 Event for start teleport. More...
 
System.EventHandler< CharacterEventArgsEndTeleport
 Event for stop teleport. More...
 
System.EventHandler< CharacterEventArgsInterruptTeleport
 Event for interrupt teleport. More...
 

Detailed Description

Air movement which allows you teleport multiple times in any direction. Note that you still move through space when teleporting

Member Function Documentation

◆ CheckForCancel()

virtual bool PlatformerPro.AirMovement_TeleportJump.CheckForCancel ( )
protectedvirtual

Checks if we hit something

Returns
true if we hit something and should cancel the attack, false otherwise.

◆ CheckInput()

virtual bool PlatformerPro.AirMovement_TeleportJump.CheckInput ( )
protectedvirtual

Check if user has entered jump input.

Returns
true, if input was checked, false otherwise.

◆ DoJump()

override void PlatformerPro.AirMovement_TeleportJump.DoJump ( )
virtual

Do the jump.

Reimplemented from PlatformerPro.AirMovement.

◆ DoMove()

override void PlatformerPro.AirMovement_TeleportJump.DoMove ( )

Moves the character.

◆ GainControl()

override void PlatformerPro.AirMovement_TeleportJump.GainControl ( )

Called when the movement gets control. Typically used to do initialisation of velocity and the like.

Returns
true, if control was gained, false otherwise.

◆ GetAimDirection()

virtual Vector2 PlatformerPro.AirMovement_TeleportJump.GetAimDirection ( )
protectedvirtual

◆ Init()

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

Initialise the movement with the given movement data.

Parameters
characterCharacter.
movementDataMovement data.

◆ LosingControl()

override void PlatformerPro.AirMovement_TeleportJump.LosingControl ( )

Called when the movement loses control. Override to do any reset type actions.

◆ OnEndTeleport()

virtual void PlatformerPro.AirMovement_TeleportJump.OnEndTeleport ( )
protectedvirtual

Raises the end teleport event.

◆ OnInterruptTeleport()

virtual void PlatformerPro.AirMovement_TeleportJump.OnInterruptTeleport ( )
protectedvirtual

Raises the interrupt teleport event.

◆ OnStartTeleport()

virtual void PlatformerPro.AirMovement_TeleportJump.OnStartTeleport ( )
protectedvirtual

Raises the start teleport event.

◆ WantsAirControl()

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

Reimplemented from PlatformerPro.AirMovement.

◆ WantsJump()

override bool PlatformerPro.AirMovement_TeleportJump.WantsJump ( )
virtual

Gets a value indicating whether this movement wants to intitiate the jump.

true

false

Reimplemented from PlatformerPro.AirMovement.

Member Data Documentation

◆ actionButton

int PlatformerPro.AirMovement_TeleportJump.actionButton

Action button to use if control type is ACTION_BUTTON_AND_DIRECTION.

◆ ActionButtonindex

const int PlatformerPro.AirMovement_TeleportJump.ActionButtonindex = 5
staticprotected

The index of the action button in the movement Data

◆ characterHealth

CharacterHealth PlatformerPro.AirMovement_TeleportJump.characterHealth
protected

Cached character health.

◆ controlType

TeleportJumpControlType PlatformerPro.AirMovement_TeleportJump.controlType

How do we control the jump.

◆ ControlTypeIndex

const int PlatformerPro.AirMovement_TeleportJump.ControlTypeIndex = 4
staticprotected

The index of the control type in the movement Data

◆ DefaultWarpDistance

float PlatformerPro.AirMovement_TeleportJump.DefaultWarpDistance = 3.0f
staticprotected

The default distance.

◆ DefaulWarpSpeed

float PlatformerPro.AirMovement_TeleportJump.DefaulWarpSpeed = 10.0f
staticprotected

The default speed.

◆ distanceTravelled

float PlatformerPro.AirMovement_TeleportJump.distanceTravelled
protected

How far have we travelled in the current warp.

◆ eventArgs

CharacterEventArgs PlatformerPro.AirMovement_TeleportJump.eventArgs
protected

Cached event args.

◆ isInvincible

bool PlatformerPro.AirMovement_TeleportJump.isInvincible

Are we invincible when teleporting?

◆ IsInvincibleIndex

const int PlatformerPro.AirMovement_TeleportJump.IsInvincibleIndex = 2
staticprotected

The index of the is invincible setting in the movement data.

◆ isWarping

bool PlatformerPro.AirMovement_TeleportJump.isWarping
protected

True when we are currently warping.

◆ maxWarpCount

int PlatformerPro.AirMovement_TeleportJump.maxWarpCount

How many times can we teleport.

◆ MaxWarpsIndex

const int PlatformerPro.AirMovement_TeleportJump.MaxWarpsIndex = 3
staticprotected

The index of the max warp count in the movement Data

◆ MovementVariableCount

const int PlatformerPro.AirMovement_TeleportJump.MovementVariableCount = 7
staticprotected

The size of the movement variable array.

◆ teleportVelocity

Vector2 PlatformerPro.AirMovement_TeleportJump.teleportVelocity
protected

Vector 2 representing direction and speed of travel.

◆ timeToNextWarp

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.

◆ TimeToNextWarpIndex

const int PlatformerPro.AirMovement_TeleportJump.TimeToNextWarpIndex = 6
staticprotected

The index of the time to next warp in the movement data.

◆ warpCount

int PlatformerPro.AirMovement_TeleportJump.warpCount
protected

Current warp count, only reset when grounded or on to wall.

◆ warpDistance

float PlatformerPro.AirMovement_TeleportJump.warpDistance

How fast the character dashes.

◆ WarpDistanceIndex

const int PlatformerPro.AirMovement_TeleportJump.WarpDistanceIndex = 1
staticprotected

The index of the distance in the movement data.

◆ warpSpeed

float PlatformerPro.AirMovement_TeleportJump.warpSpeed

How fast the character dashes.

◆ WarpSpeedIndex

const int PlatformerPro.AirMovement_TeleportJump.WarpSpeedIndex = 0
staticprotected

The index of the speed in the movement data.

◆ warpTimer

float PlatformerPro.AirMovement_TeleportJump.warpTimer
protected

How long to next warp.

Property Documentation

◆ AnimationState

override AnimationState PlatformerPro.AirMovement_TeleportJump.AnimationState
get

Gets the animation state that this movement wants to set.

The state of the animation.

◆ Info

new static MovementInfo PlatformerPro.AirMovement_TeleportJump.Info
staticget

Static movement info used by the editor.

◆ ShouldApplyGravity

override bool PlatformerPro.AirMovement_TeleportJump.ShouldApplyGravity
get

Gets a value indicating whether this PlatformerPro.Movement expects gravity to be applied after its movement finishes.

◆ WarpTimeRemaining

float PlatformerPro.AirMovement_TeleportJump.WarpTimeRemaining
get

Gets the remainig warp time.

Returns
The warp time remaining.

◆ WarpTimeRemainingAsPercentage

float PlatformerPro.AirMovement_TeleportJump.WarpTimeRemainingAsPercentage
get

Gets the remainig warp time as percentage bweten 0 and 1 (e.g. for fill bar).

Returns
The warp time remaining.

Event Documentation

◆ EndTeleport

System.EventHandler<CharacterEventArgs> PlatformerPro.AirMovement_TeleportJump.EndTeleport

Event for stop teleport.

◆ InterruptTeleport

System.EventHandler<CharacterEventArgs> PlatformerPro.AirMovement_TeleportJump.InterruptTeleport

Event for interrupt teleport.

◆ StartTeleport

System.EventHandler<CharacterEventArgs> PlatformerPro.AirMovement_TeleportJump.StartTeleport

Event for start teleport.


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