public void Launch(ShooterCreature shooterCreature, Vector2 velocity) { this.shooterCreature = shooterCreature; this.velocity = velocity; m_rigidbody2D = GetComponent <Rigidbody2D>(); m_rigidbody2D.velocity = velocity; launchHitbox.enabled = true; launchHitbox.GetComponent <Hitbox>().direction = velocity.normalized; }
public override void ChildHitboxEnterEvent(Collider2D collision, Hitbox hitbox) { if (collision.CompareTag("Enemy")) { ShooterCreature shooterCreature = collision.GetComponent <ShooterCreature>(); if (shooterCreature != null) { shooterCreature.OnHitboxEvent(hitbox, 20); //controller.Die(); } } }