- Home /
Use own file formats like custom archive files and read them at runtime
Hi,
Is there a way i can load models from a custom archive file format ?
And if so can i load them and display them in the scene (models , music, textures , etc...)
The file format is no problem but the reading it in unity part is kinda confusing me.
Thanks
Answer by whebert · Jun 14, 2013 at 09:24 PM
Absolutely you can. If you are using custom formats that you couldn't load with Resources.Load, you have access to most of the .NET framework classes (FileStream, XmlTextReader, BinaryReader, etc.) that you can use to dynamically load data at runtime. You can also build your own models as GameObjects containing MeshFilter and MeshRenderer components and a Mesh with vertices, normals, uvs, Materials with Textures, etc. - all of which you can build and assign at runtime. I haven't tried dynamically loading and assigning sound, but would guess you can do that as well.
Thanks for the info !.
I didn't know you could create a gameobject at runtime. It's all co$$anonymous$$g together in my head now !.
For the audio part maybe i can use something like my own audio class which holds a loaded audio file and return it as a playable clip ??
Just bear in $$anonymous$$d if you are making a webplayer, then that has no access to the hard drive of the computer where it is running, so your data would need to be fetched using the WWW
class.
It's a desktop game , but thanks i'll keep that in $$anonymous$$d
Your answer
![](https://koobas.hobune.stream/wayback/20220613104206im_/https://answers.unity.com/themes/thub/images/avi.jpg)