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

Ground movement that uses physics style movement and can support 360 degree loops. More...

Inheritance diagram for PlatformerPro.GroundMovement_PhysicsWithLoop:
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 Movement Init (Character character, MovementVariable[] movementData)
 Initialise the mvoement with the given movement data. More...
 
override bool ForceMaintainControl ()
 If this is true then the movement wants to maintain control of the character even if default transition conditions suggest it shouldn't. In this case we want to control the initial part of the fall from the top of a loop. 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. You should ensure that character velocity is reset back to world-relative velocity here. 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 loopSpeed = 14.0f
 How fast we need to be going to loop. More...
 
float slideDownTime = 1.0f
 How long the character slides down if they aren't looping fast enough. 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...
 

Protected Attributes

bool isLooping
 Track if the character has hit the loop at loop velocity. More...
 
float slideDownTimer
 While true ignore character horizontal input and let the character slide down. More...
 
float localFallVelocity
 When we start falling we may still be grounded due to rotation. Accordingly we can't rely on the characters y velocity so we temporarily track it here until we fall far enough for the air control to take over. More...
 
bool showLoopSettings
 Should we show loop settings in editor. More...
 
int autoLoopDirection
 The auto loop direction. 0 for NONE. More...
 
int slideDownDirection
 The direciton we are sliding down in. 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...
 

Static Protected Attributes

const int LoopSpeedIndex = 8
 The index for the loop speed value in the movement data. More...
 
const int SlideTimeIndex = 9
 The index for the slide time value in the movement data. More...
 
new const int MovementVariableCount = 10
 The size of the movement variable array. More...
 
const float DefaultLoopSpeed = 14.0f
 The default loop speed. More...
 
const float DefaultSlideTime = 1.5f
 The default slide time. More...
 
const float LoopCutOffPoint = 60.0f
 How much do we accentuate friciton in the opposite of the slide down direction 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 RaycastType ShouldDoBaseCollisions [get]
 Gets a value indicating whether this PlatformerPro.Movement expects the base collisions to be executed after its movement finishes. More...
 
override AnimationState AnimationState [get]
 Gets the animation state that this movement wants to set. More...
 
override bool ShouldApplyGravity [get]
 This class will handle gravity internally. 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...
 

Detailed Description

Ground movement that uses physics style movement and can support 360 degree loops.

Member Function Documentation

◆ ApplySlopeForce()

override void PlatformerPro.GroundMovement_PhysicsWithLoop.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_PhysicsWithLoop.DoMove ( )

Moves the character.

◆ ForceMaintainControl()

override bool PlatformerPro.GroundMovement_PhysicsWithLoop.ForceMaintainControl ( )

If this is true then the movement wants to maintain control of the character even if default transition conditions suggest it shouldn't. In this case we want to control the initial part of the fall from the top of a loop.

Returns
true

false

◆ GainControl()

override void PlatformerPro.GroundMovement_PhysicsWithLoop.GainControl ( )

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

◆ Init()

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

Initialise the mvoement with the given movement data.

Parameters
characterCharacter.
movementDataMovement data.

◆ LosingControl()

override void PlatformerPro.GroundMovement_PhysicsWithLoop.LosingControl ( )

Called when the movement loses control. Override to do any reset type actions. You should ensure that character velocity is reset back to world-relative velocity here.

Member Data Documentation

◆ autoLoopDirection

int PlatformerPro.GroundMovement_PhysicsWithLoop.autoLoopDirection
protected

The auto loop direction. 0 for NONE.

◆ DefaultLoopSpeed

const float PlatformerPro.GroundMovement_PhysicsWithLoop.DefaultLoopSpeed = 14.0f
staticprotected

The default loop speed.

◆ DefaultSlideTime

const float PlatformerPro.GroundMovement_PhysicsWithLoop.DefaultSlideTime = 1.5f
staticprotected

The default slide time.

◆ isLooping

bool PlatformerPro.GroundMovement_PhysicsWithLoop.isLooping
protected

Track if the character has hit the loop at loop velocity.

◆ localFallVelocity

float PlatformerPro.GroundMovement_PhysicsWithLoop.localFallVelocity
protected

When we start falling we may still be grounded due to rotation. Accordingly we can't rely on the characters y velocity so we temporarily track it here until we fall far enough for the air control to take over.

◆ LoopCutOffPoint

const float PlatformerPro.GroundMovement_PhysicsWithLoop.LoopCutOffPoint = 60.0f
staticprotected

How much do we accentuate friciton in the opposite of the slide down direction

◆ loopSpeed

float PlatformerPro.GroundMovement_PhysicsWithLoop.loopSpeed = 14.0f

How fast we need to be going to loop.

◆ LoopSpeedIndex

const int PlatformerPro.GroundMovement_PhysicsWithLoop.LoopSpeedIndex = 8
staticprotected

The index for the loop speed value in the movement data.

◆ MovementVariableCount

new const int PlatformerPro.GroundMovement_PhysicsWithLoop.MovementVariableCount = 10
staticprotected

The size of the movement variable array.

◆ showLoopSettings

bool PlatformerPro.GroundMovement_PhysicsWithLoop.showLoopSettings
protected

Should we show loop settings in editor.

◆ slideDownDirection

int PlatformerPro.GroundMovement_PhysicsWithLoop.slideDownDirection
protected

The direciton we are sliding down in.

◆ slideDownTime

float PlatformerPro.GroundMovement_PhysicsWithLoop.slideDownTime = 1.0f

How long the character slides down if they aren't looping fast enough.

◆ slideDownTimer

float PlatformerPro.GroundMovement_PhysicsWithLoop.slideDownTimer
protected

While true ignore character horizontal input and let the character slide down.

◆ SlideTimeIndex

const int PlatformerPro.GroundMovement_PhysicsWithLoop.SlideTimeIndex = 9
staticprotected

The index for the slide time value in the movement data.

Property Documentation

◆ AnimationState

override AnimationState PlatformerPro.GroundMovement_PhysicsWithLoop.AnimationState
get

Gets the animation state that this movement wants to set.

◆ Info

new static MovementInfo PlatformerPro.GroundMovement_PhysicsWithLoop.Info
staticget

Static movement info used by the editor.

◆ ShouldApplyGravity

override bool PlatformerPro.GroundMovement_PhysicsWithLoop.ShouldApplyGravity
get

This class will handle gravity internally.

◆ ShouldDoBaseCollisions

override RaycastType PlatformerPro.GroundMovement_PhysicsWithLoop.ShouldDoBaseCollisions
get

Gets a value indicating whether this PlatformerPro.Movement expects the base collisions to be executed after its movement finishes.


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