public override bool Interact(HoldableObject carryingObject, PlayerInteraction playerInteraction) { if (carryingObject is Key && ((Key)carryingObject).keyCode == keyCode) { playerInteraction.Drop(true); locked = false; return(true); } else { return(false); } }
public override bool Interact(HoldableObject carryingObject, PlayerInteraction playerInteraction) { if (hasBulb) { return(false); } if (carryingObject is LightBulb) { playerInteraction.Drop(true); hasBulb = true; LightToggle(); return(true); } return(false); }