t1k:unity:mobile:core
| Field | Value |
|---|---|
| Module | mobile |
| Version | 2.2.2 |
| Effort | medium |
| Tools | — |
Keywords: Android, iOS, mobile, optimization
How to invoke
Section titled “How to invoke”/t1k:unity:mobile:coreUnity Mobile — Optimization & Platform Patterns
Section titled “Unity Mobile — Optimization & Platform Patterns”Mobile development reference for Unity 6. Covers Android, iOS, and cross-platform optimization.
Form Factor: Portrait-First by Default
Section titled “Form Factor: Portrait-First by Default”Default assumption: portrait orientation. Most mobile games and casual genres ship portrait-only. Tune every demo, scene, and HUD against portrait first; landscape is a follow-up validation, not the baseline.
| Setting | Portrait baseline |
|---|---|
| Game-view aspect (validation) | 2160x1080 Portrait (Display 1) — the canonical aspect for this project |
PlayerSettings.defaultIsFullScreen | true |
PlayerSettings.allowedAutorotateToPortrait | true |
PlayerSettings.allowedAutorotateToPortraitUpsideDown | false (avoid front-camera/lens flips) |
PlayerSettings.allowedAutorotateToLandscape* | false for portrait-only titles |
| Camera projection | Orthographic for 2D / top-down; perspective with FOV ≥ 50° for 3D portrait — wide angles compensate for narrow horizontal frustum |
| Camera viewport ratio | 9:16 (or 9:19.5 / 9:20 for modern phones) — design HUD around the centered safe band |
HUD layout discipline (portrait):
- Thumb reach: bottom ~30% of the screen is the primary action zone. Place primary CTAs there.
- Top ~15% is the status band (coins/energy/timer); keep it readable when notches/cutouts intrude.
Screen.safeAreaMUST gate every Canvas anchored to the screen edge — Dynamic Island, notch, and home-indicator slabs change the usable rect.- Test text legibility at 9:19.5 and 9:20 (Pixel 7, Galaxy S23) — they crop tighter than 9:16 references.
Validation rule (matches project CLAUDE.md): When entering Play mode for any demo, the Game-view aspect MUST be 2160x1080 Portrait. A landscape Game-view at runtime is a setup bug — fix the Game-view aspect, not the demo.
Performance Targets
Section titled “Performance Targets”| Tier | Target FPS | Draw Calls | Memory |
|---|---|---|---|
| Low (budget 2019) | 30 | <100 | <200MB |
| Mid (2021 phones) | 30–60 | <200 | <400MB |
| High (2023+ flagships) | 60 | <500 | <800MB |
Frame Rate & Battery
Section titled “Frame Rate & Battery”Application.targetFrameRate = 30; // Battery-friendlyQualitySettings.vSyncCount = 0; // Required for targetFrameRate to workTexture Compression — Quick Reference
Section titled “Texture Compression — Quick Reference”| Format | Use When |
|---|---|
| ASTC 6x6 | Default for Android + iOS |
| ASTC 4x4 | UI, characters (best quality) |
| ASTC 8x8 | Terrain, backgrounds (smallest) |
| ETC2 | Android fallback for old GLES3 devices |
Set per-platform in Texture Import Settings → Platform override.
Key Optimization Areas
Section titled “Key Optimization Areas”- Shaders: Strip unused variants, use SimpleLit/Unlit, limit shadows (1 cascade, 1024px)
- Draw Calls: SRP Batcher + GPU Instancing + Texture Atlasing + Occlusion Culling
- Memory: Mipmaps on 3D textures, max 1024×1024 chars, stream music (>10s audio)
- Build Size: Managed Stripping = High, App Bundle (.aab) for Android, ARM64 only for iOS
→ See references/mobile-platform.md for full details on all categories, platform settings, gotchas.
Platform Quick Reference
Section titled “Platform Quick Reference”- Android: IL2CPP + ARM64, Vulkan (+ GLES3 fallback), API 24+, keystore for release
- iOS: IL2CPP only, Metal only, iOS 15.0+, Xcode required
- Both:
Application.lowMemoryhandler;Screen.safeAreafor notch/cutout UI
Common Gotchas
Section titled “Common Gotchas”- Editor vs Device: Always profile on target device
- Thermal throttling: Design for sustained perf (devices throttle after ~5 min)
- Background app:
OnApplicationPause(true)— save state, pause timers - Notch/cutout: Use
Screen.safeAreafor UI placement
Related Skills & Agents
Section titled “Related Skills & Agents”unity-profiling— Device profiling and bottlenecksunity-urp— Mobile rendering pipelineunity-addressables— On-demand asset loadingdots-performance— DOTS optimization (usedots-optimizeragent)
Reference Files
Section titled “Reference Files”| File | Contents |
|---|---|
references/mobile-platform.md | Full tables, platform settings, memory, build size, gotchas |