Platformer Pro  2.3.2
A platform game kit for Unity.
PlatformerPro.IMob Interface Reference

Interface used by mobile things like characters and enemies. More...

Inheritance diagram for PlatformerPro.IMob:
PlatformerPro.Character PlatformerPro.Enemy PlatformerPro.SequenceDrivenEnemy PlatformerPro.RotatingEnemy PlatformerPro.SequenceDrivenEnemy

Public Member Functions

void SetVelocityX (float x)
 Sets the velocity in x. More...
 
void SetVelocityY (float y)
 Sets the velocity in y. More...
 
void Translate (float x, float y, bool applyYTransformsInWorldSpace)
 Translate the character by the supplied amount. More...
 
bool IsColliderIgnored (Collider2D collider)
 Check if a given collider should be ignored in collisions. More...
 

Properties

AnimationState AnimationState [get]
 The current animation state. More...
 
int FacingDirection [get]
 Returns the direction being faced. 0 for none, 1 for right, -1 for left. More...
 
int LastFacedDirection [get]
 Returns the direction being faced, but if direction is currently 0 instead returns the direction last faced. More...
 
Vector2 Velocity [get]
 The characters velocity relative to self. More...
 
Vector2 PreviousVelocity [get]
 The characters velocity in the previous frame relative to self. More...
 
float SlopeTargetRotation [get]
 If slopes are on this is the rotation we are rotating towards. More...
 
float SlopeActualRotation [get]
 If slopes are on this is the rotation we are currently on. More...
 
float PreviousRotation [get]
 If slopes are on this is the rotation we were at last frame. More...
 
float IgnoredSlope [get, set]
 Gets the ignored slope. The ignored slope is used primary for internal physics calculations and is the largest slope that was ignored by the side colliders last frame. More...
 
float MinSideAngle [get]
 Gets the minimum angle at which geometry is considered a wall. More...
 
int ZLayer [get, set]
 Gets or sets the characters current z layer. More...
 
bool Grounded [get]
 Returns true if we are grounded or false otherwise. More...
 
int GroundLayer [get]
 If grounded this is the layer of the ground. Undefined if not grounded. More...
 
float Gravity [get]
 Gravity currently acting on the character. More...
 
float Friction [get, set]
 Gets the friction. More...
 

Events

System.EventHandler< AnimationEventArgsChangeAnimationState
 Event for anmation state changes. More...
 

Detailed Description

Interface used by mobile things like characters and enemies.

Member Function Documentation

◆ IsColliderIgnored()

bool PlatformerPro.IMob.IsColliderIgnored ( Collider2D  collider)

Check if a given collider should be ignored in collisions.

Returns
true if this instance is ignoring he specified collider; otherwise, false.
Parameters
colliderCollider.

Implemented in PlatformerPro.Enemy, and PlatformerPro.Character.

◆ SetVelocityX()

void PlatformerPro.IMob.SetVelocityX ( float  x)

Sets the velocity in x.

Implemented in PlatformerPro.Enemy, and PlatformerPro.Character.

◆ SetVelocityY()

void PlatformerPro.IMob.SetVelocityY ( float  y)

Sets the velocity in y.

Implemented in PlatformerPro.Enemy, and PlatformerPro.Character.

◆ Translate()

void PlatformerPro.IMob.Translate ( float  x,
float  y,
bool  applyYTransformsInWorldSpace 
)

Translate the character by the supplied amount.

Parameters
xThe x amount.
yThe y amount.
applyYTransformsInWorldSpaceShould Y transforms be in world space instead of realtive to the character position?

Implemented in PlatformerPro.Enemy, and PlatformerPro.Character.

Property Documentation

◆ AnimationState

AnimationState PlatformerPro.IMob.AnimationState
get

The current animation state.

◆ FacingDirection

int PlatformerPro.IMob.FacingDirection
get

Returns the direction being faced. 0 for none, 1 for right, -1 for left.

◆ Friction

float PlatformerPro.IMob.Friction
getset

Gets the friction.

◆ Gravity

float PlatformerPro.IMob.Gravity
get

Gravity currently acting on the character.

◆ Grounded

bool PlatformerPro.IMob.Grounded
get

Returns true if we are grounded or false otherwise.

◆ GroundLayer

int PlatformerPro.IMob.GroundLayer
get

If grounded this is the layer of the ground. Undefined if not grounded.

◆ IgnoredSlope

float PlatformerPro.IMob.IgnoredSlope
getset

Gets the ignored slope. The ignored slope is used primary for internal physics calculations and is the largest slope that was ignored by the side colliders last frame.

◆ LastFacedDirection

int PlatformerPro.IMob.LastFacedDirection
get

Returns the direction being faced, but if direction is currently 0 instead returns the direction last faced.

◆ MinSideAngle

float PlatformerPro.IMob.MinSideAngle
get

Gets the minimum angle at which geometry is considered a wall.

◆ PreviousRotation

float PlatformerPro.IMob.PreviousRotation
get

If slopes are on this is the rotation we were at last frame.

◆ PreviousVelocity

Vector2 PlatformerPro.IMob.PreviousVelocity
get

The characters velocity in the previous frame relative to self.

◆ SlopeActualRotation

float PlatformerPro.IMob.SlopeActualRotation
get

If slopes are on this is the rotation we are currently on.

◆ SlopeTargetRotation

float PlatformerPro.IMob.SlopeTargetRotation
get

If slopes are on this is the rotation we are rotating towards.

◆ Velocity

Vector2 PlatformerPro.IMob.Velocity
get

The characters velocity relative to self.

◆ ZLayer

int PlatformerPro.IMob.ZLayer
getset

Gets or sets the characters current z layer.

Event Documentation

◆ ChangeAnimationState

System.EventHandler<AnimationEventArgs> PlatformerPro.IMob.ChangeAnimationState

Event for anmation state changes.


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