-
Notifications
You must be signed in to change notification settings - Fork 12
Exitpoll Event Name Update & Pointer Offset Support #238
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: develop
Are you sure you want to change the base?
Conversation
removed unused callback in exitpollholder
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull Request Overview
This PR renames the exit poll event and adds configurable position and rotation offsets for the controller pointer.
- Renamed the custom event ID from
cvr.exitpoll
toc3d.exitpoll
. - Introduced
PointerPositionOffset
andPointerRotationOffset
parameters, exposed them in the inspector, and applied them in the pointer handler. - Updated the controller pointer setup and exit poll invocation to include the new offset parameters.
Reviewed Changes
Copilot reviewed 7 out of 7 changed files in this pull request and generated 3 comments.
Show a summary per file
File | Description |
---|---|
PointerInputHandler.cs | Added static offset fields and applied them in HandleControllerInput |
ExitPollSet.cs | Updated log message; passed new offset parameters to pointer setup |
ExitPollPointer.cs | Extended SetupControllerAsPointer signature and assigned offsets |
ExitPollParameters.cs | Added PointerPositionOffset and PointerRotationOffset fields |
ExitPollManager.cs | Renamed custom event string to "c3d.exitpoll" |
ExitPollHolder.cs | Removed obsolete session-end cleanup subscription and method |
Editor/ExitPollHolderInspector.cs | Exposed pointer offset fields in the custom inspector |
Comments suppressed due to low confidence (1)
Runtime/ExitPoll/Scripts/ExitPollHolder.cs:18
- The session-end event subscription and corresponding
Cleanup
method were removed, soExitPollHolder
no longer performs cleanup when the session ends. Ensure cleanup logic is relocated or re-added to prevent leftover UI elements or memory leaks.
{
if (positionOffset != Vector3.zero) PointerInputHandler.PointerPosOffset = positionOffset; | ||
if (rotationOffset != Vector3.zero) PointerInputHandler.PointerRotOffset = rotationOffset; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The conditional check prevents resetting the pointer position offset back to zero, which can leave stale offsets in place. Always assign the offset field regardless of its value so zero offsets are correctly applied.
if (positionOffset != Vector3.zero) PointerInputHandler.PointerPosOffset = positionOffset; | |
if (rotationOffset != Vector3.zero) PointerInputHandler.PointerRotOffset = rotationOffset; | |
PointerInputHandler.PointerPosOffset = positionOffset; | |
PointerInputHandler.PointerRotOffset = rotationOffset; |
Copilot uses AI. Check for mistakes.
@@ -52,6 +52,8 @@ internal static void SetupControllerAsPointer(GameObject pointerPrefab, ExitPoll | |||
pointerInstance.transform.localRotation = Quaternion.identity; | |||
if (pointerInstance.GetComponent<PointerInputHandler>()) | |||
{ | |||
if (positionOffset != Vector3.zero) PointerInputHandler.PointerPosOffset = positionOffset; | |||
if (rotationOffset != Vector3.zero) PointerInputHandler.PointerRotOffset = rotationOffset; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The conditional check prevents resetting the pointer rotation offset back to zero, which can leave stale offsets in place. Always assign the offset field regardless of its value so zero offsets are correctly applied.
if (rotationOffset != Vector3.zero) PointerInputHandler.PointerRotOffset = rotationOffset; | |
PointerInputHandler.PointerRotOffset = rotationOffset; |
Copilot uses AI. Check for mistakes.
public static Vector3 PointerPosOffset; | ||
|
||
/// <summary> | ||
/// Local rotation offset (in degrees) applied to the controller pointer direction. | ||
/// Useful for fine-tuning the pointer's forward angle when it doesn't align with the controller's default forward direction. | ||
/// </summary> | ||
public static Vector3 PointerRotOffset; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
[nitpick] Declaring offset fields as static means all PointerInputHandler
instances share the same values, which could conflict if multiple pointers need different offsets. Consider making these instance fields instead.
public static Vector3 PointerPosOffset; | |
/// <summary> | |
/// Local rotation offset (in degrees) applied to the controller pointer direction. | |
/// Useful for fine-tuning the pointer's forward angle when it doesn't align with the controller's default forward direction. | |
/// </summary> | |
public static Vector3 PointerRotOffset; | |
public Vector3 PointerPosOffset; | |
/// <summary> | |
/// Local rotation offset (in degrees) applied to the controller pointer direction. | |
/// Useful for fine-tuning the pointer's forward angle when it doesn't align with the controller's default forward direction. | |
/// </summary> | |
public Vector3 PointerRotOffset; |
Copilot uses AI. Check for mistakes.
Description
The following changes are made to improve the ExitPoll system:
cvr.exitpoll
toc3d.exitpoll
ExitPollHolder
inspectorLinear Issue ID(s) (If applicable): SDK-71
Type of change
Checklist