Guest User

Untitled

a guest
Jan 23rd, 2018
90
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.31 KB | None | 0 0
  1. var guiIsHot : boolean;
  2.  
  3. function Update() {
  4. if (Input.GetMouseButton(0) && GUIUtility.hotControl != 0) {
  5. guiIsHot = true;
  6. }
  7. if (Input.GetMouseButtonUp(0)) {
  8. if (!guiIsHot) {
  9. Debug.Log("Hooray!");
  10. }
  11. guiIsHot = false;
  12. }
  13. }
  14.  
  15. function OnGUI() {
  16. GUILayout.Button("button1");
  17. GUILayout.Button("button2");
  18. }
Add Comment
Please, Sign In to add comment