My game needs to use Unity 2019.3 for the console versions, and 2020.3 for the mobile ports.
The Console Project is the master project. Virtually any changes done to it are replicated to the Mobile project.
I would like to setup import overrides for Android (e.g. the compression quality for my soundtracks). To be consistent, I perform this change in my Console Project using the “Override for Android” checkbox (which affects the .meta file), and then replicate the change to the Mobile Project.
Ideally, the Mobile Project will now reflect the compression quality I want for said soundtracks, but it actually doesn’t – in fact, the “Override for Android” checkbox does not appear to be checked in the Mobile Project, despite having a .meta file identical to the Console Project.
I digged into the .meta files, and noticed that when I use “Override for Android” in my Console Project, the .meta file adds an entry code 27:
platformSettingOverrides: 27: loadType: 2 sampleRateSetting: 0 sampleRateOverride: 44100 compressionFormat: 1 quality: 0.5 conversionMode: 0
But, when I go to my Mobile Project and check the checkbox, it adds an entry coded 7:
platformSettingOverrides: 7: loadType: 2 sampleRateSetting: 0 sampleRateOverride: 44100 compressionFormat: 1 quality: 0.5 conversionMode: 0
I don’t understand this inconsistency. Does anyone have any insight on the exact conditions/rules Unity uses for the platform codes in the .meta files?
I can only think of a few dubious reasons:
- Maybe they changed from 2019 to 2020.
- My Console Project actually supports more platforms than the Mobile Project (the consoles, obviously), so maybe they “pushed” the Android code from 7 to 27.
It is not the end of the world; I could make a script that duplicates the settings of 27 into 7… But only if this behaviour is predictable or consistent. So my question is, what is Unity’s logic behind the choice of these platform codes?
Note: so far I’ve only found this behaviour on
AudioClip files. With Textures, I see that it actually uses the name of the platform in the .meta file, so the settings do work thankfully, but it is even more puzzling because now I don’t understand why Textures and AudioClips use different conventions to begin with… What other Asset Type has numeric conventions?