public void setNumRoomsMax() { if (numRoomsMax < 40) { numRoomsMax++; } else { numRoomsMax = 1; } if (numRoomsMax < numRoomsMin) { numRoomsMin = numRoomsMax; } GameObject DGMinR = GameObject.Find("dunGenMinRooms"); ButtonStuff bs = DGMinR.GetComponent <ButtonStuff> (); bs.buttonString = "Min Rooms: " + numRoomsMin; GameObject DGMaxR = GameObject.Find("dunGenMaxRooms"); bs = DGMaxR.GetComponent <ButtonStuff> (); bs.buttonString = "<Max Rooms: " + numRoomsMax + ">"; numRooms = new IntRange(numRoomsMin, numRoomsMax); }
void Update() { for (var i = 0; i < 4; i++) { ButtonStuff bs = dunGenList [i].GetComponent <ButtonStuff> (); Text t = dunGenList[i].GetComponent <Text> (); t.text = bs.buttonString; } }