Skip to content

Conversation

@willeastcott
Copy link
Contributor

Summary

  • Add comprehensive class-level JSDoc documentation with features list and usage example
  • Add @type annotations to all class properties for better TypeScript support
  • Add @import for Entity type
  • Fix export pattern to match other XR scripts (class declaration + separate export)
  • Fix sky layer save/restore to preserve original enabled state in AR mode

Details

The XrSession script was missing class-level documentation and had inconsistent patterns compared to the other XR scripts (XrControllers, XrNavigation, XrMenu). This PR brings it in line with the others and adds a bug fix for the sky layer restoration.

Documentation

  • Added comprehensive class-level JSDoc block explaining what the script does
  • Added features list and usage example
  • Added @type annotations to all previously undocumented properties

Consistency

  • Changed from \export class XrSession\ to \class XrSession extends Script { } export { XrSession };\ to match other XR scripts

Bug Fix

  • \disableSky()\ now saves the original \layer.enabled\ state before disabling

  • estoreSky()\ now restores the saved state instead of always setting \ rue\
  • This fixes a bug where the sky layer would be incorrectly enabled after exiting AR if it was already disabled before entering AR

@willeastcott willeastcott merged commit 05c5b1c into main Jan 29, 2026
7 checks passed
@willeastcott willeastcott deleted the improve-xr-session-docs branch January 29, 2026 11:29
@willeastcott willeastcott self-assigned this Jan 29, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants