- Home /
Temporary textures or Materials in Editor removed in build
Hey everyone,
I have a question about something 2D Toolkit could achieve. It's about "dereferencing" textures or materials prior to building for a platform.
How would one have all visuals during editing levels, which are completely removed from them when built? I ask this, because we want to create our own way to distinguish between low and high res devices to preload all necessary assets prior to scene loading.
Does anyone have experience with this? What would be the better approach? To somehow create temporary textures during editing which will never be packed because they only exist on ram or something like that? Or to deference everything prior to building?
Would be nice if someone could share some knowledge on the topic
Hi, I think asset bundles can do that, not only to download data from the web (like DLC) but also to have different data for multiple platforms or quality/resolution.
Thanks dns, but we want to ship the build as a whole. Is it possible to ship bundles right with the build?
Thanks dns, sounds like the easiest solutions for now. Convert your comment to an answer, k?
Answer by _dns_ · Mar 24, 2015 at 04:49 PM
Well, I only made some researches about this because I'll need it for a project (but didn't try it yet). According to the documentation it's possible: if I understand well: assetbundles are a kind of zip that needs to be downloaded + extracted before it can be instantiated from using LoadAsset. It's apparently possible to use the "file:" prefix in an url passed to LoadFromCacheOrDownload to load from a filesystem (source) or to store the bundle as an uncompressed asset in the StreamingAssets folder.
The alternative would be to use the resources folder and load resource A or B depending on the situation (and I guess you would have to manually remove the unused A or B resources before building). There are new functionality to ease the asset bundle creation in Unity5 so I guess the Unity team wants us to go this path. There are some discussions on the forums about that too.
That's all I know for now :)
Also, it could be interesting if you tell the community how it goes: there are not so much answers/search results about that subject :-)
Your answer
Follow this Question
Related Questions
Delta event out of Editor Problem 4 Answers
Serious Rendering Issue - editor vs build 3 Answers
Distribute terrain in zones 3 Answers
Scriptable Objects, how to force Include in Compile / Build without referencing it in the scene? 1 Answer
OnGUI() works in editor, but not in build with an odd twist! 2 Answers