firebase-unity-sdk icon indicating copy to clipboard operation
firebase-unity-sdk copied to clipboard

Copy GA DLL for Windows Build and Play Mode if it exists

Open jonsimantov opened this issue 6 months ago • 0 comments

This change adds analytics_win.dll (if present) to the Windows build directory / Play Mode when the Firebase Analytics module is used.

The following modifications were made:

  • Modified editor/app/src/DllLocationPatcher.cs:
    • Added logic to OnPostProcessBuild to copy analytics_win.dll from the project root to the build's plugin directory (<project_name>_Data/Plugins/) when building for StandaloneWindows or StandaloneWindows64, but only if the Firebase Analytics module is detected and the DLL exists.
  • Created editor/app/src/AnalyticsPlayModeSetup.cs:
    • This new editor script subscribes to EditorApplication.playModeStateChanged.
    • When entering Play Mode on a Windows editor, it checks for the Firebase Analytics module and the existence of analytics_win.dll in the project root.
    • If both conditions are met, it copies analytics_win.dll to Assets/Plugins/ to make it available during Play Mode.

These changes ensure that analytics_win.dll is correctly placed for both Windows builds and Play Mode sessions, facilitating proper Firebase Analytics functionality on the Windows platform.

Description

Provide details of the change, and generalize the change in the PR title above.


Testing

Describe how you've tested these changes.


Type of Change

Place an x the applicable box:

  • [ ] Bug fix. Add the issue # below if applicable.
  • [ ] New feature. A non-breaking change which adds functionality.
  • [ ] Other, such as a build process or documentation change.

jonsimantov avatar Jun 16 '25 18:06 jonsimantov