![]() |
Platformer Pro
2.3.2
A platform game kit for Unity.
|
Ground movement that uses physics style movement and can support 360 degree loops. More...
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... | |
![]() | |
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... | |
![]() | |
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... | |
![]() | |
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... | |
![]() | |
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... | |
![]() | |
bool | hasAppliedForce |
Has a force been applied this frame? If so don't quiesce. More... | |
![]() | |
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... | |
![]() | |
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... | |
![]() | |
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... | |
![]() | |
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... | |
![]() | |
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 | |
![]() | |
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... | |
![]() | |
virtual void | SnapToGround () |
Snaps the character to the ground. More... | |
Ground movement that uses physics style movement and can support 360 degree loops.
|
virtual |
Applies the slope force by setting velocity. Note this WILL NOT move the character that happens in DoMove.
Reimplemented from PlatformerPro.GroundMovement_Physics.
override void PlatformerPro.GroundMovement_PhysicsWithLoop.DoMove | ( | ) |
Moves the character.
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.
false
override void PlatformerPro.GroundMovement_PhysicsWithLoop.GainControl | ( | ) |
Called when the movement gets control. Typically used to do initialisation of velocity and the like.
override Movement PlatformerPro.GroundMovement_PhysicsWithLoop.Init | ( | Character | character, |
MovementVariable[] | movementData | ||
) |
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.
|
protected |
The auto loop direction. 0 for NONE.
|
staticprotected |
The default loop speed.
|
staticprotected |
The default slide time.
|
protected |
Track if the character has hit the loop at loop velocity.
|
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.
|
staticprotected |
How much do we accentuate friciton in the opposite of the slide down direction
float PlatformerPro.GroundMovement_PhysicsWithLoop.loopSpeed = 14.0f |
How fast we need to be going to loop.
|
staticprotected |
The index for the loop speed value in the movement data.
|
staticprotected |
The size of the movement variable array.
|
protected |
Should we show loop settings in editor.
|
protected |
The direciton we are sliding down in.
float PlatformerPro.GroundMovement_PhysicsWithLoop.slideDownTime = 1.0f |
How long the character slides down if they aren't looping fast enough.
|
protected |
While true ignore character horizontal input and let the character slide down.
|
staticprotected |
The index for the slide time value in the movement data.
|
get |
Gets the animation state that this movement wants to set.
|
staticget |
Static movement info used by the editor.
|
get |
This class will handle gravity internally.
|
get |
Gets a value indicating whether this PlatformerPro.Movement expects the base collisions to be executed after its movement finishes.