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

An object that can be pushed. More...

Inheritance diagram for PlatformerPro.Pushable:
PlatformerPro.PushablePullable

Public Member Functions

virtual void Push (IMob character, Vector2 amount, bool pushAsForce)
 Push this pushable. More...
 

Protected Attributes

bool resetVelocityOnPush = true
 Should we reset the velocity to zero before pushing. More...
 
float additionalDynamicFriction = 0.0f
 Should we apply additional friciton when moving? Helps to stop boxes sliding over the character etc when pushing as translate. More...
 
float originalY
 When using move position we use this variable to help us simulate gravity. More...
 
bool targetSet = false
 Do we have a target position More...
 
Vector2 targetPosition
 The target position for a MovePosition move. More...
 
bool forceSet = false
 Do we have a force to add. More...
 
Vector2 force
 The force to apply when using force based pushing. More...
 
float mass
 Original mass, we store it here as we change it while pushing if push mode is MovePosition(). More...
 
bool physicsUpdatedThisFrame
 Has FixedUpdate been executed? More...
 
new Rigidbody2D rigidbody2D
 Reference to the rigidbody 2D. More...
 
bool canRotate
 Can we rotate? More...
 
float canRotateTimer
 Tracks how long after pushing before we can rotate again. More...
 

Static Protected Attributes

const float canRotateTime = 0.066f
 How long after pushing before we can rotate again. More...
 

Properties

virtual float Mass [get]
 Get the pushables weight. More...
 

Detailed Description

An object that can be pushed.

Member Function Documentation

◆ Push()

virtual void PlatformerPro.Pushable.Push ( IMob  character,
Vector2  amount,
bool  pushAsForce 
)
virtual

Push this pushable.

Parameters
characterCharacter who is pushing..
amountAmount to push.

Member Data Documentation

◆ additionalDynamicFriction

float PlatformerPro.Pushable.additionalDynamicFriction = 0.0f
protected

Should we apply additional friciton when moving? Helps to stop boxes sliding over the character etc when pushing as translate.

◆ canRotate

bool PlatformerPro.Pushable.canRotate
protected

Can we rotate?

◆ canRotateTime

const float PlatformerPro.Pushable.canRotateTime = 0.066f
staticprotected

How long after pushing before we can rotate again.

◆ canRotateTimer

float PlatformerPro.Pushable.canRotateTimer
protected

Tracks how long after pushing before we can rotate again.

◆ force

Vector2 PlatformerPro.Pushable.force
protected

The force to apply when using force based pushing.

◆ forceSet

bool PlatformerPro.Pushable.forceSet = false
protected

Do we have a force to add.

◆ mass

float PlatformerPro.Pushable.mass
protected

Original mass, we store it here as we change it while pushing if push mode is MovePosition().

◆ originalY

float PlatformerPro.Pushable.originalY
protected

When using move position we use this variable to help us simulate gravity.

◆ physicsUpdatedThisFrame

bool PlatformerPro.Pushable.physicsUpdatedThisFrame
protected

Has FixedUpdate been executed?

◆ resetVelocityOnPush

bool PlatformerPro.Pushable.resetVelocityOnPush = true
protected

Should we reset the velocity to zero before pushing.

◆ rigidbody2D

new Rigidbody2D PlatformerPro.Pushable.rigidbody2D
protected

Reference to the rigidbody 2D.

◆ targetPosition

Vector2 PlatformerPro.Pushable.targetPosition
protected

The target position for a MovePosition move.

◆ targetSet

bool PlatformerPro.Pushable.targetSet = false
protected

Do we have a target position

Property Documentation

◆ Mass

virtual float PlatformerPro.Pushable.Mass
get

Get the pushables weight.

The weight.


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