Max Size of Textures from AssetBundle

Hey all,

I am building a small application where players can view a variety of 360 degrees photos on a GearVR. I decided to use AssetBundles to reduce loading times and decrease the size of the apk.

Everything seems to work fine, the only issue I have is that the MaxSize of the texture I load from the AssetBundle are set to 2048 instead of 8192.

I have changed all of the ImportSettings to match the settings I need, and use the TextureImporter to automatically import all textures using the correct settings.

class MyTexturePostprocessor : AssetPostprocessor {
    void OnPreprocessTexture() {
        TextureImporter textureImporter = (TextureImporter)assetImporter;
        textureImporter.maxTextureSize = 8192;
        textureImporter.mipmapEnabled = false;
        }
    }

My Assetbundles are build as UncompressedAssetBundles and Builtarget Android.

BuildPipeline.BuildAssetBundles("Assets/ABs", BuildAssetBundleOptions.UncompressedAssetBundle, BuildTarget.Android);

I use LoadAssetAsynch too load the textures when I need them.

IEnumerator SetImage(string url, string imageName) {
        Texture2D tex = new Texture2D(7776, 3888);

        WWW www = WWW.LoadFromCacheOrDownload(url, 1);
        yield return www;

        AssetBundle bundle = www.assetBundle;

        AssetBundleRequest request = bundle.LoadAssetAsync(imageName, typeof(Texture2D));

        tex = request.asset as Texture2D;

        manager.currentTexture = tex;

        bundle.Unload(false);

        www.Dispose();

        yield return null;
    }

Is there anyone who has experienced the same issue, or can help me solve this issue?

Regards,
Wilco

I managed to fix it, I played the code where I did not define the Texture2D size. Doing so fixed my problem.