
Ok, i get it, makes sense with that image.
So on to the options:
2D: I spent over a week on rewriting the UI to this magazine concept and this is the last hurdle, so I don't want to give up.
Using one Atlas: Do you mean if I use one atlas it would work because all sprites (using the same shader) are actually passed to Unity as a single mesh being drawn at once? If not, why else would that fix the problem?
I can't really use one atlas since I am displaying sprites which are created and modified on the fly. I would have to change the atlas at runtime and since the number of sprites constantly varies, this sounds like a huge pain if possible at all.
RenderQueue: I am thinking the RenderQueue does remain the best option here (I am not concerned about the performance hit). But for some reason it does not work.
Here is my process:
- Instantiate a Prefab that contains a UITexture
- Set the UITexture.material.renderqueue
Doesn't work
So I figure I need to instantiate the material so I do this:
GameObject clone = (GameObject)Instantiate( prefab );
UITexture texture = clone.GetComponentInChildren<UITexture>();
texture
.material = new Material
( texture
.material ); texture.material.renderQueue = customrenderqueuevalue;
Not working, textures with higher render queue values still appear behind other with lower one. Am I doing this wrong?
Is this logically wrong? Should I check into a mental institution instead?