// ------------------------------------------------------------------------------------------------------------------- void OnGUI() { Rect groupBox; GUI.skin = m_guiSkin; GUI.color = new Color(GUI.color.r, GUI.color.g, GUI.color.b, 0.85f); // Draw status bar GUI.Box(new Rect(0, 0, Screen.width, m_topHeight), ""); GUI.Label(new Rect(30, 15, 150, 20), "Money: " + m_playerToShow.getCurrentMoney() + " / " + m_playerToShow.getMoneyGoal()); GUI.Label(new Rect(160, 15, 100, 20), "Food: " + m_playerToShow.getFood()); // Draw left hand gui Rect box = new Rect(0, m_topHeight, m_leftWidth, Screen.height - m_topHeight); GUI.Box(box, "Build Menu"); groupBox = new Rect(box.x + m_guiSkin.box.border.left, box.y + m_guiSkin.box.border.top, box.xMax - m_guiSkin.box.border.left - m_guiSkin.box.border.right, box.yMax - m_guiSkin.box.border.top - m_guiSkin.box.border.bottom); //GUI.color = new Color (GUI.color.r, GUI.color.g, GUI.color.b, 0.5f); foreach (StaticGuiObject sgo in m_staticGuiObjects) { GUI.BeginGroup(groupBox, ""); float height = sgo.buildGui(); groupBox.Set(groupBox.x, groupBox.y + height, groupBox.xMax, groupBox.yMax + height); GUI.EndGroup(); } // Draw selected items GUI.color = new Color(GUI.color.r, GUI.color.g, GUI.color.b, 0.85f); if (m_guiObject != null) { m_guiObject.buildGui(); } }