Skip to content

Apple.Core: import Play Mode libraries by path instead of a full asset refresh - #129

Open
cbpalumbi wants to merge 1 commit into
apple:mainfrom
cbpalumbi:cbpalumbi/fix/playmode-asset-refresh
Open

cbpalumbi wants to merge 1 commit into
apple:mainfrom
cbpalumbi:cbpalumbi/fix/playmode-asset-refresh

Conversation

@cbpalumbi

@cbpalumbi cbpalumbi commented Oct 28, 2026 •

Copy link
Copy Markdown

Summary
ApplePlugInEnvironment.SyncronizePlayModeSupportLibraries copies each plug-in's Play Mode support library into Assets/Apple Plug-In Support/Editor/PlayModeSupport with FileUtil, which bypasses the AssetDatabase. It then calls AssetDatabase.Refresh so that Unity sees the copies. That refresh rescans every asset in the project to find a few files whose paths the method already holds.

The sync runs on every domain load. In a large project with an Apple build target active, the refresh costs several seconds each time the Editor enters Play Mode, recompiles, or opens the project.

Changes

  • Each library is imported with AssetDatabase.ImportAsset by path, and the project-wide AssetDatabase.Refresh is removed.
  • The deletes and imports run inside one StartAssetEditing / StopAssetEditing batch, so the Editor makes a single import pass.

Testing

  • Tested in a large production Unity project with Apple.Core 3.1.8 and an iOS build target. Entering Play Mode, recompiling, and opening the project each got about 7 seconds faster, and Play Mode native calls still worked.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant