bool buttonPresed = false;//to hide button after first mouseDown
Rect rectMG = new Rect(x,y,w,h)//Machine gun rect
Texture t1;// button texture
if(!buttonPresed){
if(GUI.RepeatButton(rectMG, t1, buttonStyle)){
if(CheckResources(machineGunCost)){
InstantiateTGhost(machineGunGhost, machineGunCost);
}
}
}
… this wil be work, but: If you will make “mouseOver” it will still work.
It happens only on standalone platform (Mac/PC). On mobile everything is OK,
because no “moseOver” exists on it.