ENG-74: Add GetConfiguration() to Unity AirConsole plugin#154
ENG-74: Add GetConfiguration() to Unity AirConsole plugin#154marc-n-dream wants to merge 12 commits into
Conversation
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.
7bf6ec1 to
54bca3b
Compare
54bca3b to
d17ca15
Compare
2af25b6 to
63d4b3d
Compare
There was a problem hiding this comment.
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
_configurationcaching on READY and a publicGetConfiguration()accessor (plus cache reset). - Update WebGL templates/controller HTML to AirConsole browser API
airconsole-1.11.0.jsand forwardconfigurationin 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.
- 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/)
|
|
||
| ### Added | ||
|
|
||
| - **Unity API:** `GetConfiguration` function to request the runtime configuration information for this game and platform. |
There was a problem hiding this comment.
Shouldn't that be GetGameConfiguration to match the airconsole-api's naming with getGameConfiguration ?
There was a problem hiding this comment.
Yes it should. Both here and in the tests.
The symbol search and replace did for once not pick it up correctly, fixed now.
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:_gameConfigurationprivate field stores the parsedJTokenfrom READYOnReady: parsesconfigurationfrom the READY message and stores itResetCaches: clears_gameConfigurationGetGameConfiguration()public method with XML doc (throwsNotReadyExceptionbefore READY)AirConsoleTests.cs: Additional EditMode testsTesting
All existing Unity EditMode tests continue to pass. 4 new EditMode tests added.