unity-mobile
4
总安装量
2
周安装量
#52892
全站排名
安装命令
npx skills add https://github.com/creator-hian/claude-code-plugins --skill unity-mobile
Agent 安装分布
opencode
2
gemini-cli
2
claude-code
2
github-copilot
2
codex
2
kimi-cli
2
Skill 文档
Unity Mobile Optimization
Overview
Mobile platform optimization for Unity focusing on iOS and Android performance, battery life, and deployment.
Foundation Required: unity-csharp-fundamentals (TryGetComponent, FindAnyObjectByType, null-safe coding)
Core Topics:
- IL2CPP compilation and optimization
- Memory management and profiling
- Touch input and mobile UI
- Battery life optimization
- App size reduction
- Platform-specific code
Quick Start
// Platform-specific code
#if UNITY_IOS
// iOS-specific code
Application.targetFrameRate = 60;
#elif UNITY_ANDROID
// Android-specific code
Application.targetFrameRate = 30;
#endif
// Touch input
if (Input.touchCount > 0)
{
Touch touch = Input.GetTouch(0);
if (touch.phase == TouchPhase.Began)
{
HandleTouch(touch.position);
}
}
Platform Constraints
- iOS: Metal rendering, App Store guidelines, 150MB initial download
- Android: Vulkan/OpenGL ES, API level fragmentation, 150MB initial
- Memory: 1-2GB low-end, 4-6GB high-end
- Thermal: Throttling after 5-10 minutes
Optimization Checklist
- â Texture compression: ASTC (mobile), ETC2 (Android), PVRTC (iOS)
- â Audio compression: AAC (iOS), Vorbis (Android)
- â Reduce draw calls: <100 mobile, batching
- â IL2CPP optimization: Strip engine code, managed stripping
- â Battery: Lower target framerate, reduce update frequency
Best Practices
- Profile on device: Not just Unity Editor
- Minimize allocations: Reduce GC pressure
- Touch-friendly UI: 44pt minimum touch target
- Handle pause: OnApplicationPause lifecycle
- Test on low-end: Target lowest common denominator