A projectile subtype that triggers an Explosive component when it hits something. It holds a required Explosive reference and calls Explosive.Explode() in OnHit.
/// <summary>
/// A projectile that does nothing other than explode.
/// </summary>
public class ExplosiveProjectile : Projectile
{
[RequireComponent]
public Explosive Explosive { get; set; }
protected override void OnHit( Collision collision = default )
{
Explosive.Explode();
}
}