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

Ground movement that uses physics style movement and includes run. More...

Inheritance diagram for PlatformerPro.GroundMovement_PhysicsWithRun:
PlatformerPro.GroundMovement_Physics PlatformerPro.GroundMovement PlatformerPro.IPhysicsMovement PlatformerPro.BaseMovement< GroundMovement >

Public Member Functions

override void ApplySlopeForce ()
 Applies the slope force by setting velocity. Note this WILL NOT move the character that happens in DoMove. More...
 
override void DoMove ()
 Moves the character. More...
 
override void PostCollisionDoMove ()
 Does any movement that MUST be done after collissions are calculated. More...
 
override Movement Init (Character character, MovementVariable[] movementData)
 Initialise the mvoement with the given movement data. More...
 
- Public Member Functions inherited from PlatformerPro.GroundMovement_Physics
override void DoMove ()
 Moves the character. More...
 
override void PostCollisionDoMove ()
 Does any movement that MUST be done after collissions are calculated. More...
 
override Movement Init (Character character, MovementVariable[] movementData)
 Initialise the mvoement with the given movement data. More...
 
- Public Member Functions inherited from PlatformerPro.GroundMovement
virtual bool WantsGroundControl ()
 Gets a value indicating whether this movement wants to control the movement on the ground. Default is false, with control falling back to default ground. Override if you want particular control. More...
 
virtual float ApplySlopeSpeedModifier (float speed)
 Adjusts speed to cater for vertical movement More...
 
virtual float GetSpeed (float baseSpeed)
 Gets the ground speed. More...
 
virtual float GetRunSpeed (float baseRunSpeed)
 Gets the run speed. More...
 
virtual float GetAcceleration (float baseAcceleration)
 Gets the acceleration. More...
 
- Public Member Functions inherited from PlatformerPro.BaseMovement< GroundMovement >
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 walkSpeed
 Maximum speed when run is not pressed. More...
 
- Public Attributes inherited from PlatformerPro.GroundMovement_Physics
float acceleration
 The speed the character accelerates at. More...
 
float maxSpeed
 The maximum travel speed. More...
 
float friction
 The default friction. Platforms can override this. More...
 
bool useAnalogueInput
 If true the acceleration will be multiplied via the analogue input value. More...
 
float slopeAccelerationFactor
 If non-zero the character will have acceleration applied by slopes based on gravity. The actual force will be f = g sin() * slopeAccelerationFactor. More...
 
float quiesceSpeed
 If a character is moving slower than this stop them moving. More...
 
float ignoreForce
 Forces smaller than this will be ignored (generally applies to, for example, slighlty sloped platforms or very small input values). More...
 
bool stickToGround
 Should we stick to the ground when running on a slope. More...
 

Static Protected Attributes

const int WalkSpeedIndex = 8
 The index for the walk speed. More...
 
new const int MovementVariableCount = 9
 The size of the movement variable array. More...
 
- Static Protected Attributes inherited from PlatformerPro.GroundMovement_Physics
const int AccelerationIndex = 5
 The index for the acceleration value in the movement data. More...
 
const int MaxSpeedIndex = 6
 The index for the max speed in the movement data. More...
 
const int StickToGroundIndex = 7
 The index for the stick to ground value in the movement data. More...
 
const int MovementVariableCount = 8
 The size of the movement variable array. More...
 
const float DefaultAcceleration = 40f
 The default ignore force. More...
 
const float DefaultMaxSpeed = 8f
 The default ignore force. More...
 

Properties

new static MovementInfo Info [get]
 Static movement info used by the editor. More...
 
override bool SupportsSlidingOnSlopes [get]
 Gets a value indicating whether this PlatformerPro.Movement can support automatic sliding based on the characters slope. This physics based movement can do this. More...
 
override AnimationState AnimationState [get]
 Gets the animation state that this movement wants to set. 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.GroundMovement_Physics
new static MovementInfo Info [get]
 Static movement info used by the editor. More...
 
override bool SupportsSlidingOnSlopes [get]
 Gets a value indicating whether this PlatformerPro.Movement can support automatic sliding based on the characters slope. This physics based movement can do this. More...
 
override AnimationState AnimationState [get]
 Gets the animation state that this movement wants to set. 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.GroundMovement
new static MovementInfo Info [get]
 Static movement info used by the editor. More...
 
virtual bool SupportsSlidingOnSlopes [get]
 Gets a value indicating whether this PlatformerPro.Movement can support automatic sliding based on the characters slope. More...
 
- Properties inherited from PlatformerPro.BaseMovement< GroundMovement >
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

- Static Public Attributes inherited from PlatformerPro.GroundMovement_Physics
const int FrictionIndex = 0
 The index for the friction value in the movement data. More...
 
const int UseAnalogueIndex = 1
 The index for the use analogue input value in the movement data. More...
 
const int SlopeAccelerationIndex = 2
 The index for the use slope accelration factor value in the movement data. More...
 
const int QuiesceSpeedIndex = 3
 The index for the quiesce value in the movement data. More...
 
const int IgnoreForceIndex = 4
 The index for the ignore force value in the movement data. More...
 
const float DefaultFriction = 5.0f
 The default slope acceleration. More...
 
const float DefaultSlopeAcceleration = 0.0f
 The default slope acceleration. More...
 
const float DefaultQuiesceSpeed = 0.5f
 The default quiesce Speed. More...
 
const float DefaultIgnoreForce = 2f
 The default ignore force. More...
 
- Protected Member Functions inherited from PlatformerPro.GroundMovement
virtual void SnapToGround ()
 Snaps the character to the ground. More...
 
- Protected Attributes inherited from PlatformerPro.GroundMovement_Physics
bool hasAppliedForce
 Has a force been applied this frame? If so don't quiesce. More...
 
- Protected Attributes inherited from PlatformerPro.BaseMovement< GroundMovement >
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...
 

Detailed Description

Ground movement that uses physics style movement and includes run.

Member Function Documentation

◆ ApplySlopeForce()

override void PlatformerPro.GroundMovement_PhysicsWithRun.ApplySlopeForce ( )
virtual

Applies the slope force by setting velocity. Note this WILL NOT move the character that happens in DoMove.

Reimplemented from PlatformerPro.GroundMovement_Physics.

◆ DoMove()

override void PlatformerPro.GroundMovement_PhysicsWithRun.DoMove ( )

Moves the character.

◆ Init()

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

Initialise the mvoement with the given movement data.

Parameters
characterCharacter.
movementDataMovement data.

◆ PostCollisionDoMove()

override void PlatformerPro.GroundMovement_PhysicsWithRun.PostCollisionDoMove ( )

Does any movement that MUST be done after collissions are calculated.

Member Data Documentation

◆ MovementVariableCount

new const int PlatformerPro.GroundMovement_PhysicsWithRun.MovementVariableCount = 9
staticprotected

The size of the movement variable array.

◆ walkSpeed

float PlatformerPro.GroundMovement_PhysicsWithRun.walkSpeed

Maximum speed when run is not pressed.

◆ WalkSpeedIndex

const int PlatformerPro.GroundMovement_PhysicsWithRun.WalkSpeedIndex = 8
staticprotected

The index for the walk speed.

Property Documentation

◆ AnimationState

override AnimationState PlatformerPro.GroundMovement_PhysicsWithRun.AnimationState
get

Gets the animation state that this movement wants to set.

◆ FacingDirection

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

Static movement info used by the editor.

◆ SupportsSlidingOnSlopes

override bool PlatformerPro.GroundMovement_PhysicsWithRun.SupportsSlidingOnSlopes
get

Gets a value indicating whether this PlatformerPro.Movement can support automatic sliding based on the characters slope. This physics based movement can do this.


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