Field CanBeDragged
- Namespace
- GrindFest
- Assembly
- GrindFest.dll
When false, a drag never starts on this object: OnPlayerDrag(HeroController) returns before anything is touched. Gold, arrows and cursed coins are picked up by hovering and must not be carried around.
Why a flag and not just OnDrag = null, which is what those three components used to do: OnDrag
is a plain delegate field, GoldBehaviour.OnEnable cleared it, and ItemBehaviour.Start() subscribes to it
again - and Start runs after OnEnable. So a pile that was created fresh and never recycled ended up
draggable while one that had been through LeanPool did not (measured 2026-09-23: all 7 live gold piles
had OnDrag set, one from the pool had it null; arrows and coins never cleared it at runtime at all,
only in OnValidate, which is editor-only and writes no serialized state). One gate that the drag path
reads cannot be undone by callback order.
public bool CanBeDragged
Returns
- bool
- When false, a drag never starts on this object: returns before anything is touched. Gold, arrows and cursed coins are picked up by hovering and must not be carried around. Why a flag and not just OnDrag = null, which is what those three components used to do: OnDrag is a plain delegate field, GoldBehaviour.OnEnable cleared it, and ItemBehaviour.Start() subscribes to it again - and Start runs after OnEnable. So a pile that was created fresh and never recycled ended up draggable while one that had been through LeanPool did not (measured 2026-09-23: all 7 live gold piles had OnDrag set, one from the pool had it null; arrows and coins never cleared it at runtime at all, only in OnValidate, which is editor-only and writes no serialized state). One gate that the drag path reads cannot be undone by callback order.