amplitude / unity-plugin

Official Amplitude Unity Plugin
https://developers.amplitude.com/docs/unity
MIT License
44 stars 34 forks source link

Change meta file format from binary to text #82

Closed keerthik closed 2 years ago

keerthik commented 3 years ago

Unity .meta files can be binary or text, without change in functionality in the engine.

The text format transmits via git and keeps track of change history in a human-readable way, which is very useful for a public repository.

dantetam commented 3 years ago

Hello @keerthik ,

Thank you for the observation. Did you by chance know how to do this? Is it a Unity setting unique to each developer working on the SDK? Is it a project setting?

keerthik commented 3 years ago

It is a per-project setting where you set Project Settings/Editor/Asset Serialization to Force Text. Doing this in the Unity Package Manager sample project that directly imports the root amplitude source files should make meta files and other Unity asset files (scenes, prefabs, presets, settings files, etc) human-readable with git-friendly diffsets from that point forward.

image
dantetam commented 3 years ago

Hello @keerthik , I tried this out. I only saw the .asset files change their binary. The .meta files stayed the same

keerthik commented 3 years ago

Can you confirm the project is set up to have Visible meta files?

image

I am not sure if Unity has changed its implementation to only affect new files.

This Unity Answers thread suggests that toggling to Force Binary and back to Force Text will convert all files.

If that doesn't work, you may need to delete the meta files and allow Unity to re-create them by re-loading the scene with the editor open. If I get time by this weekend I can use the latest commit from main and see if I can submit a pull request.

keerthik commented 2 years ago

It looks like main now uses text-based .meta files, so seems you folks managed to work that into one of the recent versions. It merged fine with my fork, so I'm closing this issue.

Thanks!