Class HoverClaimArbiter
Frame-scoped arbitration so the cursor-nearest claimant wins the shared hover tooltip.
public sealed class HoverClaimArbiter
- Inheritance
-
objectHoverClaimArbiter
Remarks
Within a frame the first claim stands until a strictly closer one arrives; a claim from an earlier frame never beats one from the current frame. The caller supplies the frame counter; this type is pure and has no Unity frame loop of its own.
Methods
Claim(long, object, double)
Claims this frame's hover for the given claimant if it is the first or closest claimant so far.
public void Claim(long frame, object claimant, double distanceSq)
Parameters
framelongCaller-supplied frame counter.
claimantobjectClaimant identity.
distanceSqdoubleSquared cursor distance; lower wins.
ReleaseStale(long, Func<object, bool>)
Drops the claim once its frame has passed or its claimant is gone.
public void ReleaseStale(long frame, Func<object, bool> isAlive)
Parameters
framelongCaller-supplied frame counter.
isAliveFunc<object, bool>Tests whether a still-current claimant is alive; not called when there is no claim.
Reset()
Clears the claim so the next Claim starts a new frame.
public void Reset()
Winner(long)
This frame's claim, or null when nothing has claimed it yet.
public object Winner(long frame)
Parameters
framelongCaller-supplied frame counter.
Returns
- object