Delay on running functions

i want to put delay before running certain functions. How to to it with C# in unity? example in objective C is like this [self performSelector@selector(RunThis) withObject:nil afterDelay:2.0];

yield return new WaitForSeconds(2);

http://unity3d.com/support/documentation/ScriptReference/WaitForSeconds.html

Can this solution can be input inside the onGUI()?

No, don’t put in OnGUI(). Put in the button function instead.Example:

OnGUI(){
 if(GUI.Button("button")
  Button_Event();
}

function Button_Event(){
  yield return new WaitForSeconds(2);
  //do something
}

(It’s javascript, but I am sure you know how to do)

Thanks for the info. Can this solution can be input inside the onGUI()? because i want when pressing the buttons then it will delay 2 sec after click the button.