Platformer Pro  2.3.2
A platform game kit for Unity.
AirMovement_DigitalInFacingDirection Class Reference
Inheritance diagram for AirMovement_DigitalInFacingDirection:
PlatformerPro.AirMovement_Digital PlatformerPro.AirMovement PlatformerPro.IFlippableGravityMovement PlatformerPro.BaseMovement< AirMovement >

Public Member Functions

override void GainControl ()
 Called when the movement gets control. Typically used to do initialisation of velocity and the like. More...
 
override void DoJump ()
 Do the jump. More...
 
- Public Member Functions inherited from PlatformerPro.AirMovement_Digital
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 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 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 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...
 

Protected Member Functions

override void MoveInX (float horizontalAxis, int horizontalAxisDigital, ButtonState runButton)
 Does the X movement. More...
 
- Protected Member Functions inherited from PlatformerPro.AirMovement_Digital
override void MoveInY ()
 Do the Y movement. More...
 
override void HandleGravityFlipped (object sender, System.EventArgs e)
 Handles the gravity being flipped. More...
 
- Protected Member Functions inherited from PlatformerPro.AirMovement
virtual void AddGravityFlipHandler ()
 Add handler for the gravity flip event More...
 

Protected Attributes

int facingDirection
 Direction we are facing. More...
 
- Protected Attributes inherited from PlatformerPro.AirMovement_Digital
float initialVelocity
 Derived initial velocity based on jumpHeight and relativeGravity. More...
 
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...
 
int jumpCount
 Jump count, set to 0 while not jumping, 1 while jumping, 2 while double More...
 
float doubleJumpInitialVelocity
 Derived initial velocity based on doubleJumpHeight and time. More...
 
bool jumpWhenButtonHeld
 Automatically jump when the character holds the jump button down. More...
 
float expectedJumpPeak
 Where we expect the jump to peak. More...
 
bool jumpButtonReleased
 For double track if the jump button has been released. We don't double jump if the user just holds jump. 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...
 

Properties

new static MovementInfo Info [get]
 Static movement info used by the editor. 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_Digital
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 float CurrentGravity [get]
 Gets a value indicating the current gravity, only used if this movement doesn't apply the default gravity.

See also
ShouldApplyGravity()
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...
 

Additional Inherited Members

- Public Attributes inherited from PlatformerPro.AirMovement_Digital
float airSpeed
 The (horizontal) speed the character moves at in the air. More...
 
float jumpHeight
 How high the character jumps. More...
 
float relativeJumpGravity
 The gravity applied during jump (relative to the characters Gravity component). More...
 
float groundedLeeway
 After the user leaves the ground how much additional time do we give the user to press jump and still consider them grounded. More...
 
bool canDoubleJump
 Can the character double jump. More...
 
float doubleJumpHeight
 How high the character jumps on a double jump. More...
 
int maxDoubleJumpCount
 How many times the character can double jump. -1 means infinite. More...
 
- Static Protected Attributes inherited from PlatformerPro.AirMovement_Digital
const float DefaultAirSpeed = 5.0f
 The default air speed. More...
 
const float DefaultJumpHeight = 2.0f
 The default height of the jump. More...
 
const float DefaultRelativeJumpGravity = 1.0f
 The default relative jump gravity. More...
 
const float DefaultGroundedLeeway = 0.1f
 The default grounded leeway. More...
 
const bool DefaultCanDoubleJump = false
 The default can double jump value. More...
 
const float DefaultDoubleJumpHeight = 2.0f
 The default height of the double jump. More...
 
const int AirSpeedIndex = 0
 The index for the air speed value in the movement data. More...
 
const int JumpHeightIndex = 1
 The index for the air speed value in the movement data. More...
 
const int JumpCurveIndex = 2
 The index for the jump curve value in the movement data. More...
 
const int ShowJumpDetailsIndex = 3
 The index for the value of show jumped details. Only used by editor. More...
 
const int JumpRelativeGravityIndex = 4
 The index for the relative jump gravity in the movement data. More...
 
const int GroundedLeewayIndex = 5
 The index for the ground leeway in the movement data. More...
 
const int CanDoubleJumpIndex = 6
 The index for can double jump in the movement data. More...
 
const int DoubleJumpHeightIndex = 7
 The index for the double jump height in the movement data. More...
 
const int JumpWhenButtonHeldIndex = 8
 The index for the Jump When Button Held in the movement data. More...
 
const int MaxDoubleJumpCountIndex = 9
 The index for the Max Double Jump Count in the movement data. More...
 
const int MovementVariableCount = 10
 The size of the movement variable array. More...
 

Member Function Documentation

◆ DoJump()

override void AirMovement_DigitalInFacingDirection.DoJump ( )
virtual

Do the jump.

Reimplemented from PlatformerPro.AirMovement_Digital.

◆ GainControl()

override void AirMovement_DigitalInFacingDirection.GainControl ( )

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

◆ MoveInX()

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

Does the X movement.

Reimplemented from PlatformerPro.AirMovement_Digital.

Member Data Documentation

◆ facingDirection

int AirMovement_DigitalInFacingDirection.facingDirection
protected

Direction we are facing.

Property Documentation

◆ FacingDirection

override int AirMovement_DigitalInFacingDirection.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 AirMovement_DigitalInFacingDirection.Info
staticget

Static movement info used by the editor.


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