在UI元素上统一绘制纹理

时间:2018-10-17 19:54:54

标签: unity3d

enter image description here

    private void OnGUI()
{
    healthMeterPos.height = 20;
    healthMeterPos.width = 64;
    healthBarPos.height = 16;
    healthBarPos.width = 48;
    GUI.DrawTexture(healthMeterPos, healthMeter);
    GUI.DrawTextureWithTexCoords(healthBarPos, healthBar, new Rect(healthFract, 0f, 1f, 1f));
}

这是我用来绘制healthBar的代码,但问题始终在我通过面板添加的普通UI元素上方。如何对它们进行不同排序?

0 个答案:

没有答案