Quantcast
Channel: Answers for "Gui Buttons Single and Double click"
Viewing all articles
Browse latest Browse all 6

Answer by spinaljack

$
0
0

save a time stamp for the last click and then check the current click to see if it is less than a short amount of time. e.g.

var lastClick : float = 0;

if(GUI.Button(Rect(someRect),"double click button")){
  if(Time.time-lastClick<0.3){
     // do something
  }else{
     // do something else
  }
  lastClick = Time.time;
  print(lastClick);
}

Viewing all articles
Browse latest Browse all 6

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>