This file guides AI agents on how to continue the development of the Android Large Screen and Foldable optimizations in this project.
- Unity Thread Safety: Ensure UI redraws and screen updates are called on the main Unity Thread. Use the
ExecuteOnMainUnityThreadhelper coroutine/method inside ConfigurationManager.cs if callbacks originate from native Android threads (viaUnityPlayer.UnitySendMessage). - Manifest Integrity: Do NOT modify or remove configuration-related
<activity>attributes in AndroidManifest.xml (such asandroid:resizeableActivity="true"orandroid:configChanges) unless explicitly asked, as this will break dynamic resizing and folding capabilities. - Cross-Platform Editing/Testing: Although the target runtime is Android, game logic and UI adjustments should be testable in the Unity Editor using Play Mode.
- Vibe Coding / Collaboration: Use the Artifact System to propose plans and designs for user review before execution. Keep artifacts in sync with design documentation when required.
- No Unrelated Refactoring: Adhere strictly to the "Surgical Changes" rule in GEMINI.md. Touch only what is necessary to solve the issue or implement the feature.
- Relative Paths: Do NOT use absolute file paths in documentation, references, or links. Always use paths relative to the project root.
Follow the guidelines in GEMINI.md. Specifically:
- Plan First: State assumptions and a step-by-step verification plan before editing code.
- Goal-Driven: Define clear success criteria (e.g., "ensure UI adjustments react to fold change callback in Unity Editor Play Mode" or "verify Java payload serializes fold state correct").
- Step-by-step Implementation: Implement changes incrementally and verify them before proceeding.
- Engine: Unity Editor
6000.5.4f1 - Languages: C# (for Unity scripts, Game/UI logic), Java (for native Android activity/bridge)
- Libraries: Universal Render Pipeline (URP), Unity Input System, Android Jetpack WindowManager (
androidx.window:window:1.3.0&androidx.window:window-java:1.3.0).
- Native Android Controller: LargeScreenPlayableActivity.java - Hooks into Jetpack WindowManager, formats and sends display/fold telemetry.
- Unity Bridge: ConfigurationManager.cs - Receives configuration and fold messages from Java, manages callbacks on main thread.
- UI Adapters:
- SafeZoneUI.cs - Adjusts UI canvas anchors to match safe areas.
- Gameplay Adapter:
- ConfigurationResponse.cs - Handles game pauses/resumes during configuration changes.
- Unity Editor Play Mode: Play the project inside Unity Editor to verify UI scaling and basic layout responsiveness.
- Unity Build & Android Run: Perform Android APK build and test on foldable emulator or physical large screen/foldable device to verify native Jetpack WindowManager integration.