Skip to content

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

Open
marc-n-dream wants to merge 8 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 8 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 GetConfiguration() to the Unity AirConsole plugin. The method returns the platform capability configuration injected into the READY event by the appengine.

Changes

  • AirConsole.cs:
    • _configuration private field stores the parsed JToken from READY
    • OnReady: parses configuration from the READY message and stores it
    • ResetCaches: clears _configuration
    • New GetConfiguration() public method with XML doc (screen-only note, throws NotReadyException before READY)
  • AirConsoleTests.cs: 4 EditMode tests total:
    • GetConfiguration_WhenReady_ReturnsConfiguration — happy path
    • GetConfiguration_BeforeReady_ThrowsNotReadyException — pre-READY guard
    • GetConfiguration_AfterResetCaches_ReturnsNull — cache clear
    • GetConfiguration_WhenReadyDataLacksConfiguration_ReturnsNull — absent key
    • SimulateResetCaches() reflection helper added to AirConsoleTestRunner

Dependencies

Depends on airconsole-appengine PR #3488 being merged first — that PR injects the configuration payload into the READY event. Can be merged in parallel with airconsole-api.

Testing

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

Jira

ENG-74

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 on lines +673 to +674
/// Returns null if not yet received or on controllers.
/// </returns>

[UnityTest]
[Timeout(300)]
public IEnumerator GetConfiguration_AfterResetCaches_ReturnsNull() {
Comment on lines +381 to +385
// Use reflection to invoke the private OnReady method
var method = typeof(AirConsole).GetMethod("OnReady",
System.Reflection.BindingFlags.NonPublic | System.Reflection.BindingFlags.Instance);
method.Invoke(this, new object[] { message });
}
Comment on lines +388 to +393
// Use reflection to invoke the private ResetCaches method.
// Passes a no-op action because we do not need the post-clear callback in tests.
var method = typeof(AirConsole).GetMethod("ResetCaches",
System.Reflection.BindingFlags.NonPublic | System.Reflection.BindingFlags.Instance);
method.Invoke(this, new object[] { (System.Action)(() => { }) });
}
Comment on lines +86 to +89
[UnityTest]
[Timeout(300)]
public IEnumerator GetConfiguration_AfterReady_ReturnsConfiguration() {
if (EditorUserBuildSettings.activeBuildTarget != BuildTarget.Android) {
Comment thread AGENTS.md
Comment on lines +13 to +16
## ENTRY POINT
Main SDK entry: `Assets/AirConsole/AirConsole.cs`.
`AirConsole.cs` owns the singleton.
The singleton is the main public API surface.
Comment thread AGENTS.md
Comment on lines +38 to +40
## ANDROID BRIDGE
Android bridge code lives under `Assets/AirConsole/Plugins/Android/`.
`PluginManager` initializes native bridge state.
Comment thread AGENTS.md
Comment on lines +60 to +63
`Assets/AirConsole/Plugins/Android/` contains native bridge code and Android plugin assets.
`Assets/AirConsole/Editor/` contains editor tooling and build postprocessing.
`Assets/AirConsole/Editor/PostprocessBuild` is the build generation area.
Sample scenes live under the AirConsole assets tree.
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.

2 participants