Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- var guiIsHot : boolean;
- function Update() {
- if (Input.GetMouseButton(0) && GUIUtility.hotControl != 0) {
- guiIsHot = true;
- }
- if (Input.GetMouseButtonUp(0)) {
- if (!guiIsHot) {
- Debug.Log("Hooray!");
- }
- guiIsHot = false;
- }
- }
- function OnGUI() {
- GUILayout.Button("button1");
- GUILayout.Button("button2");
- }
Add Comment
Please, Sign In to add comment