feat: expose Handle.Targets and Handle.Pivot; deprecate Handle.Target#43
Merged
Conversation
Handle.Target returned the manipulation pivot (the ghost), not the selected object — a long-standing confusion the README warned about twice, with no public way to get the actual manipulated objects. Add: - Handle.Targets (IReadOnlyCollection<Transform>) — the real objects - Handle.Pivot — honest name for the ghost/pivot - TransformHandleManager.GetTargets(handle) and TransformGroup.Targets Handle.Target is now [Obsolete] -> Pivot. Internal axis/group code switched to Pivot (zero obsolete-usage warnings). Non-breaking; Target keeps working until the next major. Adds PlayMode coverage for Targets membership + pivot identity.
…n equality CollectionAssert.DoesNotContain on UnityEngine.Object is unreliable (fake-null == override made pivot and target compare equal on Mono/2021.3, failing the floor leg). Assert reference identity + Ghost-component instead; the multi-select test already proves Targets membership works.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Why
Handle.Targetreturns the manipulation pivot (the ghost), not the user's selected object — the README warns about this twice, and there was no public way to ask a handle which objects it manipulates. In an event callback you got theHandlebut couldn't get back to the dragged object(s) without your own side-map.What (additive, non-breaking)
Handle.Targets(IReadOnlyCollection<Transform>) — the actual manipulated objects (live, read-only).Handle.Pivot— honest name for the ghost/pivot.TransformHandleManager.GetTargets(handle)andTransformGroup.Targets— same data at those levels.Handle.Target→[Obsolete], forwards toPivot. Keeps working until the next major.Internal axis/group code switched from
TargettoPivotso the package compiles with zero obsolete-usage warnings. The ghost/pivot transform model is unchanged — this is naming/exposure only.Tests
New PlayMode coverage:
Targetscontains the selected object(s) and excludes the pivot; multi-select membership; existing tests updated toPivot. Package + tests are compiled and run by CI (EditMode + PlayMode + 2021.3 floor).🤖 Generated with Claude Code
Note
Low Risk
Additive API with obsolete forwarders; manipulation still goes through the ghost pivot and group logic is unchanged aside from naming.
Overview
Clarifies a confusing public API:
Handle.Targetwas the manipulation ghost/pivot, not the selected object(s). The PR adds a proper way to query what a handle controls and renames the pivot concept without changing manipulation behavior.New public surface:
Handle.Targets(live read-only collection of manipulated transforms),Handle.Pivot(ghost pivot),TransformHandleManager.GetTargets(handle), andTransformGroup.Targets.Handle.Targetis marked[Obsolete]and forwards toPivotuntil the next major.Package internals (position/rotation/scale handle components,
Enable/Disable, docs, changelog, README examples) now usePivotinstead ofTarget. PlayMode tests cover single- and multi-selectTargetsvsPivot.Reviewed by Cursor Bugbot for commit 45e0fd0. Bugbot is set up for automated code reviews on this repo. Configure here.