protected virtual void OnProjectileUpdate(ProjectileHandler projectile) { if (projectile.LifeSpan < projectile.Airtime) { projectile.ToDestroy(); return; } projectile.transform.position += (Vector3)projectile.Velocity * Time.deltaTime; }
protected override void OnProjectileUpdate(ProjectileHandler projectile) { if (projectile.LifeSpan < projectile.Airtime) { projectile.ToDestroy(); return; } float s = 1 - (projectile.Airtime / projectile.LifeSpan); projectile.transform.localScale = new Vector3(s, s, 1); }
protected virtual void OnProjectileHit( ProjectileHandler projectile, Collider2D collision) { if (projectile.IsSameSender(collision.gameObject)) { return; } BaseController controller = collision.gameObject .GetComponent <BaseController>(); if (controller) { controller.ProjectileHit(projectile); } projectile.ToDestroy(); }