If you want something to happen repeatedly while the user holds down that button, use GUI.RepeatButton(). If you are looking for a toggle button (click once -> button stays enabled and wood is produced. click again -> button gets disabled), use GUI.Toggle().
var addingWood : boolean = false; //flag to set if we are adding wood
function OnGUI()
{
if(GUI.Button(Rect(90,10,150,40),"Work"))
{
if(!addingWood)
{
InvokeRepeating("addWood",0.0,1.0); // add wood each second
addingWood = true;
}
}
}
function Update()
{
if(someConditionToStopAddingWood())
{
CancelInvoke("addWood");
addingWood = false;
}
}
function addWood()
{
print(Construction.Wood);
Construction.Wood += 10;
}