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

Ground movement which allows character to push things. More...

Inheritance diagram for PlatformerPro.GroundMovement_Push:
PlatformerPro.GroundMovement PlatformerPro.BaseMovement< GroundMovement >

Public Member Functions

override Movement Init (Character character, MovementVariable[] movementData)
 Initialise the mvoement with the given movement data. More...
 
override bool WantsGroundControl ()
 Gets a value indicating whether this movement wants to control the movement on the ground. This movement wants control if the side colliders are pushing against a box. More...
 
override void DoMove ()
 Moves the character. More...
 
override void LosingControl ()
 Called when the movement loses control. Override to do any reset type actions. More...
 
- Public Member Functions inherited from PlatformerPro.GroundMovement
virtual void ApplySlopeForce ()
 Applies slope force. 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 speedAdjustment
 Speed adjustment factor. More...
 
bool pushAsForce
 Do we push the character using force? If false we just use transform. More...
 
float maxWeight
 How much can the character push. More...
 
bool weightAffectsSpeed
 Should we consider object weight when adjusting speed. More...
 

Protected Attributes

Pushable pushable
 The current thing being pushed. More...
 
float initialPushOffset
 How far is the pushable offset when the push starts. More...
 
float pushDirection
 The direction we are pushing. 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 float MaxYVelocity = 0.525f
 Don't allow pushing if moving in Y faster than this. More...
 
const int SpeedAdjustmentIndex = 0
 The index of the speed adjustment. More...
 
const int MaxWeightIndex = 1
 The index of the max weight. More...
 
const int WeightAffectsSpeedIndex = 2
 The index of weight affects speed. More...
 
const int PushAsForceIndex = 3
 The index of push as force. More...
 
const int MovementVariableCount = 4
 The size of the movement variable array. More...
 

Properties

new static MovementInfo Info [get]
 Static movement info used by the editor. More...
 
override AnimationState AnimationState [get]
 Gets the animation state that this movement wants to set. More...
 
override int FacingDirection [get]
 
override bool PreventXVelocityReset [get]
 Don't allow base collisions to reset X velocity. 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 which allows character to push things.

Member Function Documentation

◆ DoMove()

override void PlatformerPro.GroundMovement_Push.DoMove ( )

Moves the character.

◆ Init()

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

Initialise the mvoement with the given movement data.

Parameters
characterCharacter.
movementDataMovement data.

◆ LosingControl()

override void PlatformerPro.GroundMovement_Push.LosingControl ( )

Called when the movement loses control. Override to do any reset type actions.

◆ WantsGroundControl()

override bool PlatformerPro.GroundMovement_Push.WantsGroundControl ( )
virtual

Gets a value indicating whether this movement wants to control the movement on the ground. This movement wants control if the side colliders are pushing against a box.

true if this instance wants control; otherwise, false.

Reimplemented from PlatformerPro.GroundMovement.

Member Data Documentation

◆ initialPushOffset

float PlatformerPro.GroundMovement_Push.initialPushOffset
protected

How far is the pushable offset when the push starts.

◆ maxWeight

float PlatformerPro.GroundMovement_Push.maxWeight

How much can the character push.

◆ MaxWeightIndex

const int PlatformerPro.GroundMovement_Push.MaxWeightIndex = 1
staticprotected

The index of the max weight.

◆ MaxYVelocity

const float PlatformerPro.GroundMovement_Push.MaxYVelocity = 0.525f
staticprotected

Don't allow pushing if moving in Y faster than this.

◆ MovementVariableCount

const int PlatformerPro.GroundMovement_Push.MovementVariableCount = 4
staticprotected

The size of the movement variable array.

◆ pushable

Pushable PlatformerPro.GroundMovement_Push.pushable
protected

The current thing being pushed.

◆ pushAsForce

bool PlatformerPro.GroundMovement_Push.pushAsForce

Do we push the character using force? If false we just use transform.

◆ PushAsForceIndex

const int PlatformerPro.GroundMovement_Push.PushAsForceIndex = 3
staticprotected

The index of push as force.

◆ pushDirection

float PlatformerPro.GroundMovement_Push.pushDirection
protected

The direction we are pushing.

◆ speedAdjustment

float PlatformerPro.GroundMovement_Push.speedAdjustment

Speed adjustment factor.

◆ SpeedAdjustmentIndex

const int PlatformerPro.GroundMovement_Push.SpeedAdjustmentIndex = 0
staticprotected

The index of the speed adjustment.

◆ weightAffectsSpeed

bool PlatformerPro.GroundMovement_Push.weightAffectsSpeed

Should we consider object weight when adjusting speed.

◆ WeightAffectsSpeedIndex

const int PlatformerPro.GroundMovement_Push.WeightAffectsSpeedIndex = 2
staticprotected

The index of weight affects speed.

Property Documentation

◆ AnimationState

override AnimationState PlatformerPro.GroundMovement_Push.AnimationState
get

Gets the animation state that this movement wants to set.

◆ FacingDirection

override int PlatformerPro.GroundMovement_Push.FacingDirection
get

Returns the direction the character is facing. 0 for none, 1 for right, -1 for left. This overriden version always returns the default ground movements facing direction.

◆ Info

new static MovementInfo PlatformerPro.GroundMovement_Push.Info
staticget

Static movement info used by the editor.

◆ PreventXVelocityReset

override bool PlatformerPro.GroundMovement_Push.PreventXVelocityReset
get

Don't allow base collisions to reset X velocity.


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