Max texture size at run-time?

Is there a way to query the device’s max texture size at run-time from Unity?

I want to use 4096 textures and switch to “half-res” quality setting on devices that don’t support it, but I don’t see a way to determine that.

I found this for native code:

int[] max = new int[1];
gl.glGetIntegerv(GL10.GL_MAX_TEXTURE_SIZE, max, 0); //put the maximum texture size in the array.

But hoping there is some way through Unity to access this information. Thanks!

Unity reduces texture resolution automatically when necessary as far as I know.

–Eric

In my testing, it did not. I tried to run it on a tablet that did not support 4096 and I get black boxes. When I switch to half-res manually, it works fine though. I did the same test on iOS with same results. iOS is much easier test though because any screen over 1024 width supports 4096. Using 3.5.6f4

OK, maybe that only worked on the desktop then.

–Eric

So any solutions out there?