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

Ground movement that uses physics style movement. More...

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

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
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 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 Public Attributes

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 Attributes

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...
 

Static Protected Attributes

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
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

- Protected Member Functions inherited from PlatformerPro.GroundMovement
virtual void SnapToGround ()
 Snaps the character to the ground. More...
 

Detailed Description

Ground movement that uses physics style movement.

Member Function Documentation

◆ ApplySlopeForce()

override void PlatformerPro.GroundMovement_Physics.ApplySlopeForce ( )
virtual

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

Reimplemented from PlatformerPro.GroundMovement.

Reimplemented in PlatformerPro.GroundMovement_PhysicsWithRun, and PlatformerPro.GroundMovement_PhysicsWithLoop.

◆ DoMove()

override void PlatformerPro.GroundMovement_Physics.DoMove ( )

Moves the character.

◆ Init()

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

Initialise the mvoement with the given movement data.

Parameters
characterCharacter.
movementDataMovement data.

◆ PostCollisionDoMove()

override void PlatformerPro.GroundMovement_Physics.PostCollisionDoMove ( )

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

Member Data Documentation

◆ acceleration

float PlatformerPro.GroundMovement_Physics.acceleration

The speed the character accelerates at.

◆ AccelerationIndex

const int PlatformerPro.GroundMovement_Physics.AccelerationIndex = 5
staticprotected

The index for the acceleration value in the movement data.

◆ DefaultAcceleration

const float PlatformerPro.GroundMovement_Physics.DefaultAcceleration = 40f
staticprotected

The default ignore force.

◆ DefaultFriction

const float PlatformerPro.GroundMovement_Physics.DefaultFriction = 5.0f
static

The default slope acceleration.

◆ DefaultIgnoreForce

const float PlatformerPro.GroundMovement_Physics.DefaultIgnoreForce = 2f
static

The default ignore force.

◆ DefaultMaxSpeed

const float PlatformerPro.GroundMovement_Physics.DefaultMaxSpeed = 8f
staticprotected

The default ignore force.

◆ DefaultQuiesceSpeed

const float PlatformerPro.GroundMovement_Physics.DefaultQuiesceSpeed = 0.5f
static

The default quiesce Speed.

◆ DefaultSlopeAcceleration

const float PlatformerPro.GroundMovement_Physics.DefaultSlopeAcceleration = 0.0f
static

The default slope acceleration.

◆ friction

float PlatformerPro.GroundMovement_Physics.friction

The default friction. Platforms can override this.

◆ FrictionIndex

const int PlatformerPro.GroundMovement_Physics.FrictionIndex = 0
static

The index for the friction value in the movement data.

◆ hasAppliedForce

bool PlatformerPro.GroundMovement_Physics.hasAppliedForce
protected

Has a force been applied this frame? If so don't quiesce.

◆ ignoreForce

float PlatformerPro.GroundMovement_Physics.ignoreForce

Forces smaller than this will be ignored (generally applies to, for example, slighlty sloped platforms or very small input values).

◆ IgnoreForceIndex

const int PlatformerPro.GroundMovement_Physics.IgnoreForceIndex = 4
static

The index for the ignore force value in the movement data.

◆ maxSpeed

float PlatformerPro.GroundMovement_Physics.maxSpeed

The maximum travel speed.

◆ MaxSpeedIndex

const int PlatformerPro.GroundMovement_Physics.MaxSpeedIndex = 6
staticprotected

The index for the max speed in the movement data.

◆ MovementVariableCount

const int PlatformerPro.GroundMovement_Physics.MovementVariableCount = 8
staticprotected

The size of the movement variable array.

◆ quiesceSpeed

float PlatformerPro.GroundMovement_Physics.quiesceSpeed

If a character is moving slower than this stop them moving.

◆ QuiesceSpeedIndex

const int PlatformerPro.GroundMovement_Physics.QuiesceSpeedIndex = 3
static

The index for the quiesce value in the movement data.

◆ slopeAccelerationFactor

float PlatformerPro.GroundMovement_Physics.slopeAccelerationFactor

If non-zero the character will have acceleration applied by slopes based on gravity. The actual force will be f = g sin() * slopeAccelerationFactor.

◆ SlopeAccelerationIndex

const int PlatformerPro.GroundMovement_Physics.SlopeAccelerationIndex = 2
static

The index for the use slope accelration factor value in the movement data.

◆ stickToGround

bool PlatformerPro.GroundMovement_Physics.stickToGround

Should we stick to the ground when running on a slope.

◆ StickToGroundIndex

const int PlatformerPro.GroundMovement_Physics.StickToGroundIndex = 7
staticprotected

The index for the stick to ground value in the movement data.

◆ UseAnalogueIndex

const int PlatformerPro.GroundMovement_Physics.UseAnalogueIndex = 1
static

The index for the use analogue input value in the movement data.

◆ useAnalogueInput

bool PlatformerPro.GroundMovement_Physics.useAnalogueInput

If true the acceleration will be multiplied via the analogue input value.

Property Documentation

◆ AnimationState

override AnimationState PlatformerPro.GroundMovement_Physics.AnimationState
get

Gets the animation state that this movement wants to set.

◆ FacingDirection

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

Static movement info used by the editor.

◆ SupportsSlidingOnSlopes

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