Skip to content

t1k:unity:mobile:core

FieldValue
Modulemobile
Version2.2.2
Effortmedium
Tools

Keywords: Android, iOS, mobile, optimization

/t1k:unity:mobile:core

Unity Mobile — Optimization & Platform Patterns

Section titled “Unity Mobile — Optimization & Platform Patterns”

Mobile development reference for Unity 6. Covers Android, iOS, and cross-platform optimization.

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.

SettingPortrait baseline
Game-view aspect (validation)2160x1080 Portrait (Display 1) — the canonical aspect for this project
PlayerSettings.defaultIsFullScreentrue
PlayerSettings.allowedAutorotateToPortraittrue
PlayerSettings.allowedAutorotateToPortraitUpsideDownfalse (avoid front-camera/lens flips)
PlayerSettings.allowedAutorotateToLandscape*false for portrait-only titles
Camera projectionOrthographic for 2D / top-down; perspective with FOV ≥ 50° for 3D portrait — wide angles compensate for narrow horizontal frustum
Camera viewport ratio9: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.safeArea MUST 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.

TierTarget FPSDraw CallsMemory
Low (budget 2019)30<100<200MB
Mid (2021 phones)30–60<200<400MB
High (2023+ flagships)60<500<800MB
Application.targetFrameRate = 30; // Battery-friendly
QualitySettings.vSyncCount = 0; // Required for targetFrameRate to work
FormatUse When
ASTC 6x6Default for Android + iOS
ASTC 4x4UI, characters (best quality)
ASTC 8x8Terrain, backgrounds (smallest)
ETC2Android fallback for old GLES3 devices

Set per-platform in Texture Import Settings → Platform override.

  1. Shaders: Strip unused variants, use SimpleLit/Unlit, limit shadows (1 cascade, 1024px)
  2. Draw Calls: SRP Batcher + GPU Instancing + Texture Atlasing + Occlusion Culling
  3. Memory: Mipmaps on 3D textures, max 1024×1024 chars, stream music (>10s audio)
  4. 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.

  • Android: IL2CPP + ARM64, Vulkan (+ GLES3 fallback), API 24+, keystore for release
  • iOS: IL2CPP only, Metal only, iOS 15.0+, Xcode required
  • Both: Application.lowMemory handler; Screen.safeArea for notch/cutout UI
  1. Editor vs Device: Always profile on target device
  2. Thermal throttling: Design for sustained perf (devices throttle after ~5 min)
  3. Background app: OnApplicationPause(true) — save state, pause timers
  4. Notch/cutout: Use Screen.safeArea for UI placement
  • unity-profiling — Device profiling and bottlenecks
  • unity-urp — Mobile rendering pipeline
  • unity-addressables — On-demand asset loading
  • dots-performance — DOTS optimization (use dots-optimizer agent)
FileContents
references/mobile-platform.mdFull tables, platform settings, memory, build size, gotchas