Hi,
For my game I store all resources into .res file, so I can get bytes of each a resource file in runtime (like a zip file). For load texture with bytes data source it’s not a problem : Texture2D.FromStream(... and my bytes image).
But after lot of search on the web, I can’t find a way to load a model from bytes data… just content.Load<Model>(string)
work where string is the name of xnb file but content.Load(xnbBytesArray)
doesn’t exist and Model.FromStream( ...)
. And it’s impossible for performance/security reasons, to extract each model of the .res file, to load each file model with the content manager and after delete all created files.
I know we can’t import .fbx files directly because they need to pass into the content processor but when I compile my project, I found my models into .xnb file.
So if in runtime I have bytes array data of a xnb model file, how can I do for create a Model instance with that ?
Thank you a lot.