C# Class UnityPlatformer.Item

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

Public Properties

Property Type Description
animationName string
facing Facing
offset UnityEngine.Vector3

Public Methods

Method Description
Enter ( Character p ) : void

notify Character is in area item

Exit ( Character p ) : void

notify Character is out area item

GetCenter ( ) : Vector3

Get real-world-coordinates center

IsUsableBy ( Character p ) : bool

everybody can use this item otherwise, override

OnTriggerEnter2D ( Collider2D o ) : void

When HitBox(EnterAreas) enter -> Enter

OnTriggerExit2D ( Collider2D o ) : void

When HitBox(EnterAreas) leave -> Exit

PositionCharacter ( Character p ) : void

Set the position/facing of the player to the desired values

Start ( ) : void

Get BoxCollider2D

Use ( Character p ) : void

Implement this function with the action that need to performed

Method Details

Enter() public method

notify Character is in area item
public Enter ( Character p ) : void
p Character
return void

Exit() public method

notify Character is out area item
public Exit ( Character p ) : void
p Character
return void

GetCenter() public method

Get real-world-coordinates center
public GetCenter ( ) : Vector3
return UnityEngine.Vector3

IsUsableBy() public method

everybody can use this item otherwise, override
public IsUsableBy ( Character p ) : bool
p Character
return bool

OnTriggerEnter2D() public method

When HitBox(EnterAreas) enter -> Enter
public OnTriggerEnter2D ( Collider2D o ) : void
o UnityEngine.Collider2D
return void

OnTriggerExit2D() public method

When HitBox(EnterAreas) leave -> Exit
public OnTriggerExit2D ( Collider2D o ) : void
o UnityEngine.Collider2D
return void

PositionCharacter() public method

Set the position/facing of the player to the desired values
public PositionCharacter ( Character p ) : void
p Character
return void

Start() public method

Get BoxCollider2D
public Start ( ) : void
return void

Use() public abstract method

Implement this function with the action that need to performed
public abstract Use ( Character p ) : void
p Character
return void

Property Details

animationName public_oe property

animation name to play when using
public string animationName
return string

facing public_oe property

Character facing when playing animation
public Facing facing
return Facing

offset public_oe property

Character offset when playing animation
public Vector3,UnityEngine offset
return UnityEngine.Vector3