Skip to content

ENG-74: Add GetConfiguration() to Unity AirConsole plugin#154

Open
marc-n-dream wants to merge 12 commits into
masterfrom
feature/ENG-74-platform-capability-configuration
Open

ENG-74: Add GetConfiguration() to Unity AirConsole plugin#154
marc-n-dream wants to merge 12 commits into
masterfrom
feature/ENG-74-platform-capability-configuration

Conversation

@marc-n-dream
Copy link
Copy Markdown
Collaborator

@marc-n-dream marc-n-dream commented Mar 30, 2026

Summary

Adds GetGameConfiguration() to the Unity AirConsole plugin. The method returns the platform capability configuration injected into the READY event by the appengine.

Changes

  • AirConsole.cs:
    • _gameConfiguration private field stores the parsed JToken from READY
    • OnReady: parses configuration from the READY message and stores it
    • ResetCaches: clears _gameConfiguration
    • New GetGameConfiguration() public method with XML doc (throws NotReadyException before READY)
  • AirConsoleTests.cs: Additional EditMode tests

Testing

All existing Unity EditMode tests continue to pass. 4 new EditMode tests added.

Parse configuration from OnReady message into _configuration field,
reset it in ResetCaches, and expose via GetConfiguration() returning
a JToken with supportedVideoFormats, transparentVideoSupported,
unityVideoSupported, and graphicsQualityTier. Adds EditMode test.

ENG-74 Task 4
…, Task 6)

Clarify that GetConfiguration() is only available on the screen device,
returns null on controllers, and is delivered via the ready event.
BeforeReady_ThrowsNotReadyException, AfterResetCaches_ReturnsNull,
WhenReadyDataLacksConfiguration_ReturnsNull — closes review finding M3.
Also adds SimulateResetCaches() reflection helper to AirConsoleTestRunner.
@marc-n-dream marc-n-dream force-pushed the feature/ENG-74-platform-capability-configuration branch from 7bf6ec1 to 54bca3b Compare May 29, 2026 03:27
@marc-n-dream marc-n-dream force-pushed the feature/ENG-74-platform-capability-configuration branch from 54bca3b to d17ca15 Compare May 29, 2026 03:33
@marc-n-dream marc-n-dream force-pushed the feature/ENG-74-platform-capability-configuration branch from 2af25b6 to 63d4b3d Compare May 29, 2026 03:36
@marc-n-dream marc-n-dream requested a review from Copilot May 29, 2026 03:44
Copy link
Copy Markdown

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Adds support for receiving a platform capability configuration payload from the READY event and exposes it via a new AirConsole.GetConfiguration() API. This also bumps the required AirConsole browser API to 1.11.0 and updates WebGL templates/examples accordingly, with new EditMode tests and a new example.

Changes:

  • Add _configuration caching on READY and a public GetConfiguration() accessor (plus cache reset).
  • Update WebGL templates/controller HTML to AirConsole browser API airconsole-1.11.0.js and forward configuration in the onReady payload.
  • Add EditMode tests and a new “configuration” example scene/script (plus asmdef update for TextMeshPro).

Reviewed changes

Copilot reviewed 21 out of 26 changed files in this pull request and generated 8 comments.

Show a summary per file
File Description
CHANGELOG.md Notes the new Unity API GetConfiguration in Unreleased.
Assets/WebGLTemplates/AirConsole-U6/index.html Bumps AirConsole JS API to 1.11.0.
Assets/WebGLTemplates/AirConsole-U6/airconsole-unity-plugin.js Adds configuration to the READY payload posted back to Unity.
Assets/WebGLTemplates/AirConsole-2020/index.html Bumps AirConsole JS API to 1.11.0.
Assets/WebGLTemplates/AirConsole-2020/airconsole-unity-plugin.js Adds configuration to the READY payload posted back to Unity.
Assets/AirConsole/scripts/Tests/EditMode/AirConsoleTests.cs Adds GetConfiguration EditMode tests and reflection helpers.
Assets/AirConsole/scripts/Runtime/Settings.cs Raises required minimum AirConsole JS API version to 1.11.0.
Assets/AirConsole/scripts/Runtime/AirConsole.cs Stores READY configuration, clears it on cache reset, exposes GetConfiguration().
Assets/AirConsole/extras/controller-template.html Bumps AirConsole JS API to 1.11.0.
Assets/AirConsole/examples/translations/translations-controller.html Bumps AirConsole JS API to 1.11.0.
Assets/AirConsole/examples/swipe/swipe-controller.html Bumps AirConsole JS API to 1.11.0.
Assets/AirConsole/examples/safe-area/safearea-controller.html Bumps AirConsole JS API to 1.11.0.
Assets/AirConsole/examples/pong/controller.html Bumps AirConsole JS API to 1.11.0.
Assets/AirConsole/examples/platformer/platformer-controller.html Bumps AirConsole JS API to 1.11.0.
Assets/AirConsole/examples/game-states/controller-game-states.html Bumps AirConsole JS API to 1.11.0.
Assets/AirConsole/examples/configuration/ExampleConfigurationLogic.cs.meta New meta for the configuration example script.
Assets/AirConsole/examples/configuration/ExampleConfigurationLogic.cs New example showing how to read and display GetConfiguration() values.
Assets/AirConsole/examples/configuration/configuration.unity.meta New meta for the configuration example scene.
Assets/AirConsole/examples/configuration/configuration-controller.html.meta New meta for the configuration example controller HTML.
Assets/AirConsole/examples/configuration/configuration-controller.html New controller HTML for the configuration example.
Assets/AirConsole/examples/configuration.meta New meta for the configuration example folder.
Assets/AirConsole/examples/basic/controller.html Bumps AirConsole JS API to 1.11.0.
Assets/AirConsole/examples/AirConsole.Examples.asmdef Adds TextMeshPro reference for the new example.
Assets/AirConsole/AGENTS.md Adds a subtree-specific agents guide for Assets/AirConsole.
AGENTS.md Replaces root agents doc with a new overview (currently has incorrect paths).
Files not reviewed (4)
  • Assets/AirConsole/examples/configuration.meta: Language not supported
  • Assets/AirConsole/examples/configuration/ExampleConfigurationLogic.cs.meta: Language not supported
  • Assets/AirConsole/examples/configuration/configuration-controller.html.meta: Language not supported
  • Assets/AirConsole/examples/configuration/configuration.unity.meta: Language not supported

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread Assets/AirConsole/scripts/Runtime/AirConsole.cs Outdated
Comment thread Assets/AirConsole/scripts/Tests/EditMode/AirConsoleTests.cs Outdated
Comment thread Assets/AirConsole/scripts/Tests/EditMode/AirConsoleTests.cs
Comment thread Assets/AirConsole/scripts/Tests/EditMode/AirConsoleTests.cs
Comment thread Assets/AirConsole/scripts/Tests/EditMode/AirConsoleTests.cs Outdated
Comment thread AGENTS.md
Comment thread AGENTS.md
Comment thread AGENTS.md Outdated
- Fix GetConfiguration() XML doc: 'null if not yet received' was
  misleading since the method throws NotReadyException when not ready;
  clarify returns doc to say null only when ready payload lacked
  configuration, or when called on a controller
- Add Assert.IsNotNull guards in SimulateReady() and SimulateResetCaches()
  after GetMethod so a private method rename fails with a clear test
  failure rather than a NullReferenceException
- Fix AGENTS.md paths: AirConsole.cs entry point, Plugins/ casing, and
  Editor/PostprocessBuild paths all pointed to non-existent locations;
  update to actual paths (scripts/Runtime/, plugins/, scripts/Editor/,
  scripts/Editor/BuildAutomation/)
Comment thread Assets/AirConsole/scripts/Tests/EditMode/AirConsoleTests.cs Outdated
Comment thread Assets/AirConsole/examples/configuration/ExampleConfigurationLogic.cs Outdated
Comment thread CHANGELOG.md Outdated

### Added

- **Unity API:** `GetConfiguration` function to request the runtime configuration information for this game and platform.
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Shouldn't that be GetGameConfiguration to match the airconsole-api's naming with getGameConfiguration ?

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes it should. Both here and in the tests.

The symbol search and replace did for once not pick it up correctly, fixed now.

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.

3 participants