- Home /
Why does assetbundle load change texture size?
Hi all,
I'm using an AssetBundle to load some textures on my Android project. The bundle and the textures load okay - but any of the textures which had a MaxSize bigger than 1024 in their "Override for Android" settings when i created the assetbundle (from the editor options) - get imported at the wrong size. I.e. too small. My code basically says -
loadedTexture = (Texture2D)www.assetBundle.Load(resourceName,typeof(Texture2D));
and i was expecting that if i then queried the loadedTexture width for example i would get 2048 on those textures which had a maxSize of 2048 (they are that big) when the assetbundle was made. But i don't - it comes back at 1024... anybody know why that is? Thanks
Answer by Ross_S · May 05, 2013 at 10:31 AM
Duh! Okay it was because in my Editor/ExportAssetBundles.cs file I needed to add BuildTarget.Android explicitly to the build command - I assumed it would be taking the current build target if none was given... but not the case...
so there ye go... a warning to ye all...
I took the liberty of accepting your answer do the question is closed ;)
Your answer
Follow this Question
Related Questions
Get asset size from script 1 Answer
Splitting Large texture among multiple planes 1 Answer
Size of texture after building too big 2 Answers
Assetbundle Textures appear black on Android, although they work fine in the GameView 0 Answers
How to find what texture compression was forced for build? 1 Answer