Does Unity share sound files?

Hi guys,

This is a newbie performance question.

I have 2 objects. They each have the same script applied which uses five different sound files in an AudioClip Array. I use the same five sound files in each script.

This will be important simply because I will end up with the thirty or more objects using this script each with the same five sound files.

**Does Unity treat these as ten different sound files or does it recognise the sound files as being the same? As in, will it have to load/store the sound files multiple times. **

I hope I explained this well enough.

Many thanks for your time!



Hi BruceT,

Unity will recognise that they are the same files because you refer to the same ones.

If it is critical then you could run some tests by building your project and looking at the file sizes generated.

Hope it helps.