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

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

Inheritance diagram for PlatformerPro.GroundMovement_Pull:
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 pulling a box. More...
 
override void DoMove ()
 Moves the character. More...
 
override void PostCollisionDoMove ()
 Does any movement that MUST be done after collissions are calculated. 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 speed
 Speed if weight is not affecting us. More...
 
float maxWeight
 How much can the character pull. More...
 
bool weightAffectsSpeed
 Should we consider object weight when adjusting speed. More...
 

Protected Attributes

IPullable pullable
 The current thing being pushed. More...
 
float initialPullOffset
 How far is the pullable offset when the pull starts. More...
 
float pullDirection
 The direction we are pushing. More...
 
bool latched
 Are we latched on to something? More...
 
float pullDelayTimer
 Are we still latched even though we let go of button. More...
 
float latchTimer
 How lond do we have before we can't latch without pressing towards object. 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 SpeedIndex = 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 MovementVariableCount = 3
 The size of the movement variable array. More...
 
const float PullDelayTime = 0.125f
 A small delay before pull so a user can double tap to stop pulling. More...
 
const float LatchTime = 0.75f
 How long do we give the user to start pulling before resetting back to a normal state. 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]
 
- 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 pull things.

Member Function Documentation

◆ DoMove()

override void PlatformerPro.GroundMovement_Pull.DoMove ( )

Moves the character.

◆ Init()

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

Initialise the mvoement with the given movement data.

Parameters
characterCharacter.
movementDataMovement data.

◆ LosingControl()

override void PlatformerPro.GroundMovement_Pull.LosingControl ( )

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

◆ PostCollisionDoMove()

override void PlatformerPro.GroundMovement_Pull.PostCollisionDoMove ( )

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

◆ WantsGroundControl()

override bool PlatformerPro.GroundMovement_Pull.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 pulling a box.

true if this instance wants control; otherwise, false.

Reimplemented from PlatformerPro.GroundMovement.

Member Data Documentation

◆ initialPullOffset

float PlatformerPro.GroundMovement_Pull.initialPullOffset
protected

How far is the pullable offset when the pull starts.

◆ latched

bool PlatformerPro.GroundMovement_Pull.latched
protected

Are we latched on to something?

◆ LatchTime

const float PlatformerPro.GroundMovement_Pull.LatchTime = 0.75f
staticprotected

How long do we give the user to start pulling before resetting back to a normal state.

◆ latchTimer

float PlatformerPro.GroundMovement_Pull.latchTimer
protected

How lond do we have before we can't latch without pressing towards object.

◆ maxWeight

float PlatformerPro.GroundMovement_Pull.maxWeight

How much can the character pull.

◆ MaxWeightIndex

const int PlatformerPro.GroundMovement_Pull.MaxWeightIndex = 1
staticprotected

The index of the max weight.

◆ MovementVariableCount

const int PlatformerPro.GroundMovement_Pull.MovementVariableCount = 3
staticprotected

The size of the movement variable array.

◆ pullable

IPullable PlatformerPro.GroundMovement_Pull.pullable
protected

The current thing being pushed.

◆ PullDelayTime

const float PlatformerPro.GroundMovement_Pull.PullDelayTime = 0.125f
staticprotected

A small delay before pull so a user can double tap to stop pulling.

◆ pullDelayTimer

float PlatformerPro.GroundMovement_Pull.pullDelayTimer
protected

Are we still latched even though we let go of button.

◆ pullDirection

float PlatformerPro.GroundMovement_Pull.pullDirection
protected

The direction we are pushing.

◆ speed

float PlatformerPro.GroundMovement_Pull.speed

Speed if weight is not affecting us.

◆ SpeedIndex

const int PlatformerPro.GroundMovement_Pull.SpeedIndex = 0
staticprotected

The index of the speed adjustment.

◆ weightAffectsSpeed

bool PlatformerPro.GroundMovement_Pull.weightAffectsSpeed

Should we consider object weight when adjusting speed.

◆ WeightAffectsSpeedIndex

const int PlatformerPro.GroundMovement_Pull.WeightAffectsSpeedIndex = 2
staticprotected

The index of weight affects speed.

Property Documentation

◆ AnimationState

override AnimationState PlatformerPro.GroundMovement_Pull.AnimationState
get

Gets the animation state that this movement wants to set.

◆ FacingDirection

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

Static movement info used by the editor.


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