platformer
|
A projectile is an Object that move and collide with the environment. More...
Public Member Functions | |
virtual Projectile | Fire (Vector3 position) |
Clone the projectile, activate, add it to UpdateManager and return :) More... | |
virtual void | PlatformerUpdate (float delta) |
Move projectile accordingly More... | |
virtual void | LatePlatformerUpdate (float delta) |
Do nothing use PlatformerUpdate instead More... | |
virtual void | OnTriggerEnter2D (Collider2D o) |
When collide with something, check the mask, then check if it's damageable, and Destroy More... | |
virtual void | Destroy () |
Destroy Projectile waiting destroyDelay if needed More... | |
void | DestroyNow () |
Real destroy method More... | |
Public Attributes | |
LayerMask | collisionMask |
Layers wich destroy the projectile: StaticGeometry + HitBox + Projectiles More... | |
Vector2 | velocity |
Initial velocity More... | |
Vector2 | gravity = Vector2.zero |
Gravity, Projectiles ignore global gravity, usually everyone want straight projectiles More... | |
float | destroyDelay |
Delay after impact before destroying the projectile More... | |
Action | onImpact |
Callback when impact something More... | |
Action | onDestroy |
Callback when is destroyed More... | |
A projectile is an Object that move and collide with the environment.
If a projectile collide with a HitBox then deal damage
If a projectile collide witht the world is destroyed
|
inlinevirtual |
Destroy Projectile waiting destroyDelay if needed
|
inline |
Real destroy method
|
inlinevirtual |
Clone the projectile, activate, add it to UpdateManager and return :)
|
inlinevirtual |
Do nothing use PlatformerUpdate instead
Implements UnityPlatformer.IUpdateEntity.
|
inlinevirtual |
When collide with something, check the mask, then check if it's damageable, and Destroy
|
inlinevirtual |
Move projectile accordingly
Implements UnityPlatformer.IUpdateEntity.
LayerMask UnityPlatformer.Projectile.collisionMask |
Layers wich destroy the projectile: StaticGeometry + HitBox + Projectiles
float UnityPlatformer.Projectile.destroyDelay |
Delay after impact before destroying the projectile
Vector2 UnityPlatformer.Projectile.gravity = Vector2.zero |
Gravity, Projectiles ignore global gravity, usually everyone want straight projectiles
Action UnityPlatformer.Projectile.onDestroy |
Callback when is destroyed
Action UnityPlatformer.Projectile.onImpact |
Callback when impact something
Vector2 UnityPlatformer.Projectile.velocity |
Initial velocity