C# Class UnityPlatformer.Projectile

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

Public Properties

Property Type Description
onDestroy System.Action
onImpact System.Action

Public Methods

Method Description
Awake ( ) : void

When Object is Awake, it will be automatically disabled When Fired the projectile, will be cloned and enabled

Destroy ( ) : void

Destroy Projectile waiting destroyDelay if needed

Fire ( Vector3 position ) : Projectile

Clone the projectile, activate, add it to UpdateManager and return :)

LatePlatformerUpdate ( float delta ) : void

Do nothing use PlatformerUpdate instead

OnTriggerEnter2D ( Collider2D o ) : void

When collide with something, check the mask, then check if it's damageable, and Destroy

PlatformerUpdate ( float delta ) : void

Move projectile accordingly

Protected Methods

Method Description
_Destroy ( ) : void

Real destroy method

Method Details

Awake() public method

When Object is Awake, it will be automatically disabled When Fired the projectile, will be cloned and enabled
public Awake ( ) : void
return void

Destroy() public method

Destroy Projectile waiting destroyDelay if needed
public Destroy ( ) : void
return void

Fire() public method

Clone the projectile, activate, add it to UpdateManager and return :)
public Fire ( Vector3 position ) : Projectile
position Vector3
return Projectile

LatePlatformerUpdate() public method

Do nothing use PlatformerUpdate instead
public LatePlatformerUpdate ( float delta ) : void
delta float
return void

OnTriggerEnter2D() public method

When collide with something, check the mask, then check if it's damageable, and Destroy
public OnTriggerEnter2D ( Collider2D o ) : void
o UnityEngine.Collider2D
return void

PlatformerUpdate() public method

Move projectile accordingly
public PlatformerUpdate ( float delta ) : void
delta float
return void

_Destroy() protected method

Real destroy method
protected _Destroy ( ) : void
return void

Property Details

onDestroy public_oe property

Callback when is destroyed
public Action,System onDestroy
return System.Action

onImpact public_oe property

Callback when impact something
public Action,System onImpact
return System.Action