C# Class UnityPlatformer.Ladder

Inheritance: UnityEngine.MonoBehaviour
Mostrar archivo Open project: llafuente/unity-platformer Class Usage Examples

Public Methods

Method Description
DisableLadder ( Character p ) : void

Notify Character to exit ladder area

Dismount ( Character p ) : void

Notify Character to exit ladder state For example if character jumps.

EnableLadder ( Character p ) : void

Notify Character is on ladder area

GetBottom ( ) : Vector3

get real-world-coordinates bottom of the ladder

GetTop ( ) : Vector3

get real-world-coordinates top of the ladder

IsAboveTop ( Character c, Vector2 pos ) : bool

Return if the character at given position will be above the top this is used to know before moving the character is will reach the top in the next frame

IsAtBottom ( Character c, Vector2 pos ) : bool

Return if the Character is very close to the bottom

IsAtTop ( Character c, Vector2 pos ) : bool

Return if the Character is very close to the top

IsBelowBottom ( Character c, Vector2 pos ) : bool

Return if the character at given position will be above the botom this is used to know before moving the character is will reach the botom in the next frame

OnTriggerEnter2D ( Collider2D o ) : void

if a hitbox (EnterAreas) enters -> EnableLadder

OnTriggerExit2D ( Collider2D o ) : void

if a hitbox (EnterAreas) lave -> DisableLadder

Start ( ) : void

get BoxCollider2D

Private Methods

Method Description
OnDrawGizmos ( ) : void

Method Details

DisableLadder() public method

Notify Character to exit ladder area
public DisableLadder ( Character p ) : void
p Character
return void

Dismount() public method

Notify Character to exit ladder state For example if character jumps.
public Dismount ( Character p ) : void
p Character
return void

EnableLadder() public method

Notify Character is on ladder area
public EnableLadder ( Character p ) : void
p Character
return void

GetBottom() public method

get real-world-coordinates bottom of the ladder
public GetBottom ( ) : Vector3
return UnityEngine.Vector3

GetTop() public method

get real-world-coordinates top of the ladder
public GetTop ( ) : Vector3
return UnityEngine.Vector3

IsAboveTop() public method

Return if the character at given position will be above the top this is used to know before moving the character is will reach the top in the next frame
public IsAboveTop ( Character c, Vector2 pos ) : bool
c Character
pos UnityEngine.Vector2
return bool

IsAtBottom() public method

Return if the Character is very close to the bottom
public IsAtBottom ( Character c, Vector2 pos ) : bool
c Character
pos UnityEngine.Vector2
return bool

IsAtTop() public method

Return if the Character is very close to the top
public IsAtTop ( Character c, Vector2 pos ) : bool
c Character
pos UnityEngine.Vector2
return bool

IsBelowBottom() public method

Return if the character at given position will be above the botom this is used to know before moving the character is will reach the botom in the next frame
public IsBelowBottom ( Character c, Vector2 pos ) : bool
c Character
pos UnityEngine.Vector2
return bool

OnTriggerEnter2D() public method

if a hitbox (EnterAreas) enters -> EnableLadder
public OnTriggerEnter2D ( Collider2D o ) : void
o UnityEngine.Collider2D
return void

OnTriggerExit2D() public method

if a hitbox (EnterAreas) lave -> DisableLadder
public OnTriggerExit2D ( Collider2D o ) : void
o UnityEngine.Collider2D
return void

Start() public method

get BoxCollider2D
public Start ( ) : void
return void