/// <summary>
/// Panel drawing UI elements that are supposed to be in front of this
/// </summary>
public UIPanel PanelOfFrontUILayer;
void SetUpRenderQueue()
{
// find the first draw call this needs to be in front of
UIDrawCall lastDrawCall = null;
for (int i = 0; i < UIDrawCall.list.size; i++)
if (UIDrawCall.list[i].panel == PanelOfFrontUILayer)
lastDrawCall = UIDrawCall.list[i];
if(lastDrawCall != null)
renderer.material.renderQueue = lastDrawCall.finalRenderQueue - 1;
}