Exemplo n.º 1
0
    private void OnGUI()
    {
        bodyWorldOffset = new Vector2(position.width / 6, 0);

        body.SetRect(new Rect(bodyWorldOffset.x, bodyWorldOffset.y, position.width - bodyWorldOffset.x * 2,
                              position.height - bodyWorldOffset.y * 2));

        // drawing the background body
        GUI.DrawTexture(body.GetRect(), body.GetTexture());

        DrawBody();
        window.Repaint();
    }
Exemplo n.º 2
0
    private void DrawLayouts()
    {
        // layouts need to get refreshed in order to maintain aspect ratio
        header.SetRect(0, 0, position.width, 45);
        leftSide.SetRect(0, header.GetRect().height, 220, position.height - header.GetRect().height);
        rightSide.SetRect(position.width - 220, header.GetRect().height, 220, position.height - header.GetRect().height);
        body.SetRect(leftSide.GetRect().width, header.GetRect().y + header.GetRect().height, position.width - leftSide.GetRect().width - rightSide.GetRect().width,
                     position.height - header.GetRect().height);

        foreach (var item in sections)
        {
            GUI.DrawTexture(item.GetRect(), item.GetTexture());
        }
    }