I have a script for building placement in a RTS game and was wondering how I could convert it’s current OnGUI function to the new UI system.
it’s current code is
public GameObject[] buildings;
private BuildingPlacement buildingPlacement;
void Start()
{
buildingPlacement = GetComponent<BuildingPlacement>();
}
void OnGUI()
{
for(int i = 0; i < buildings.Length; i++)
if(GUI.Button(new Rect(Screen.width / 20, Screen.height / 15 + Screen.height / 12 * i, 100, 30), buildings*.name))*
-
{*
_ buildingPlacement.SetItem(buildings*);_
_ }_
_ }*_