How to detect double click on GUI Button in unity ??

I want to perform different actions on the single and double click of GUI button but I am getting trouble with that. Help me ?? how to detect double click on GUI button??

One way is to keep a record of the last clicked button (just make up numbers) and the time. Check “Was I clicked 1/2 sec ago” when you’re clicked, otherwise save your # and time:

int lastButNum=-1;
float lastClickTime=-99;
const float D_CLICK_DELAY = 0.25f; // how long between d-click clicks

// button #1:
if( GUI.Button...) {
  if(lastClickTime > Time.time - D_CLICK_DELAY && lastButNum==1)
    // double-click
  else {
    // highlight or something
    lastClickTime=Time.time; lastButNum=1; // wait for 2nd click
  }
}

Then all of your buttons, even ones that don’t have double clicks, need to reset lastButNum (So I can’t click A, B, A and have it count as a double-click on A, but what are the odds?)

You can’t do that. What you can do is create a cube(which will become your button), add a collider and detect the double click on the collider.