Skip to content

feat: expose Handle.Targets and Handle.Pivot; deprecate Handle.Target#43

Merged
manaporkun merged 2 commits into
mainfrom
feat/handle-targets-pivot
Jun 11, 2026
Merged

feat: expose Handle.Targets and Handle.Pivot; deprecate Handle.Target#43
manaporkun merged 2 commits into
mainfrom
feat/handle-targets-pivot

Conversation

@manaporkun

@manaporkun manaporkun commented Jun 11, 2026

Copy link
Copy Markdown
Owner

Why

Handle.Target returns 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 the Handle but 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) and TransformGroup.Targets — same data at those levels.
  • Handle.Target[Obsolete], forwards to Pivot. Keeps working until the next major.

Internal axis/group code switched from Target to Pivot so the package compiles with zero obsolete-usage warnings. The ghost/pivot transform model is unchanged — this is naming/exposure only.

Tests

New PlayMode coverage: Targets contains the selected object(s) and excludes the pivot; multi-select membership; existing tests updated to Pivot. 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.Target was 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), and TransformGroup.Targets. Handle.Target is marked [Obsolete] and forwards to Pivot until the next major.

Package internals (position/rotation/scale handle components, Enable/Disable, docs, changelog, README examples) now use Pivot instead of Target. PlayMode tests cover single- and multi-select Targets vs Pivot.

Reviewed by Cursor Bugbot for commit 45e0fd0. Bugbot is set up for automated code reviews on this repo. Configure here.

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.
@manaporkun manaporkun merged commit 4a63f85 into main Jun 11, 2026
11 checks passed
@manaporkun manaporkun deleted the feat/handle-targets-pivot branch June 11, 2026 14:57
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant