协作头脑风暴
brainstorming
在实现前澄清需求、探索设计选择,并形成清晰的开发方向。
unity-build-platforms【开发与工程】Unity builds — IL2CPP vs Mono, build profiles, addressables-aware builds, Android (Gradle, AAB, Play Asset Delivery), iOS (Xcode post-processing, capabilities), WebGL, console NDA paths (high-level only). USE WHEN: configuring build settings, fixing platform-specific issues, signing, store submission, build size optimization, multi-platform CI. DO …
独立 GitHub 快照 · 自动分类 · 以原作者文档为准
name: unity-build-platforms description: | Unity builds — IL2CPP vs Mono, build profiles, addressables-aware builds, Android (Gradle, AAB, Play Asset Delivery), iOS (Xcode post-processing, capabilities), WebGL, console NDA paths (high-level only).
USE WHEN: configuring build settings, fixing platform-specific issues, signing, store submission, build size optimization, multi-platform CI.
unity-editor-tooling); runtime
perf (use unity-performance).
allowed-tools: Read, Grep, Glob, Write, Edit| Backend | Where | Trade-off |
|---|---|---|
| IL2CPP | All shipping builds | AOT-compiled, smaller perf surprises, slow build, larger binary |
| Mono | Editor + dev iteration | Fast build, dynamic features, larger memory, JIT not allowed on iOS |
Ship IL2CPP for production on every platform that supports it.
Window > Build Profiles — distinct configs per target (development PC, release PC, mobile dev, mobile release). Each profile has its own scripting backend, scenes list, scripting defines, and build path.
Assets/Plugins/Android/ for AAR/JAR drops. Use Custom Main Manifest / Custom Gradle Properties when third-party SDKs need them — avoid editing Library/ generated files.
Mandatory on Play Store since 2021. Configure:
Splits content into install-time / fast-follow / on-demand asset packs. Pair with Addressables: configure remote group → builds into .aab asset packs. Use for big games (>150 MB base APK limit).
Declare only what you use; runtime-request location/camera/mic. Recent Android requires Manifest.permission.POST_NOTIFICATIONS for push.
Unity → Xcode project → archive → notarize/upload via Xcode or altool. Most issues come from Build Phases missing entitlements; fix via OnPostprocessBuild:
[PostProcessBuild]
public static void Modify(BuildTarget t, string path) {
if (t != BuildTarget.iOS) return;
var pbx = new PBXProject();
var pbxPath = PBXProject.GetPBXProjectPath(path);
pbx.ReadFromFile(pbxPath);
string targetGuid = pbx.GetUnityMainTargetGuid();
pbx.AddFrameworkToProject(targetGuid, "UserNotifications.framework", false);
pbx.WriteToFile(pbxPath);
}
Push (UserNotifications), Sign in with Apple, Game Center, IAP — via Capabilities. Privacy strings (NSCameraUsageDescription) — must explain user-visible reason.
Constraints:
Disable: bloom (heavy), realtime shadows (gather), reflection probes if static.
Behind NDA. High-level: separate Unity install per platform; console-specific Build Pipeline calls; first-party libs (PSN/Xbox Live/Nintendo Account) wrap their own SDK on top of Unity. Get developer account + Unity console license before scoping.
# pseudo-yaml: matrix over platforms
strategy:
matrix:
target: [StandaloneWindows64, Android, iOS]
steps:
- uses: game-ci/unity-builder@v4
with:
targetPlatform: ${{ matrix.target }}
buildMethod: CIBuild.Build
| Anti-pattern | Fix |
|---|---|
| Mono on shipping mobile | IL2CPP + ARM64 |
| Engine code stripping disabled | Enable High; add link.xml for reflection types |
| Forgotten dev provisioning profile | Use distribution profile in Release builds |
| Big base APK exceeding 150 MB | PAD asset packs + Addressables |
| WebGL gzip on a host that doesn't decompress | Brotli or Disabled compression |
| Same scripting defines across all platforms | Per-platform defines in Build Profiles |