public override void PickUp(PickupGetter getter) { //first, give health back, if applicable Destructible destructible = getter.GetComponent <Destructible>(); if (destructible != null) { destructible.RecoverHitPoints(recoveryAmount); } //then, do our default behavior base.PickUp(getter); }
public override void PickUp(PickupGetter getter) { //first, give health back, if applicable Jumper jumper = getter.GetComponent <Jumper>(); if (jumper != null) { jumper.jumpImpulse += jumpImpulseIncrease; } //then, do our default behavior base.PickUp(getter); }