Forked from unitycoder/gist:8310e7da082617ea125e
Last active
August 29, 2015 14:23
-
-
Save JT5D/43bff93636f8233bd0d3 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| EventSystem eventSystem; | |
| //.. | |
| void Start () | |
| { | |
| GameObject go = GameObject.Find("EventSystem"); | |
| if (go==null) | |
| { | |
| Debug.LogError("EventSystem not founded.."); | |
| }else{ | |
| eventSystem = go.GetComponent<UnityEngine.EventSystems.EventSystem>(); | |
| } | |
| } | |
| // .. | |
| void Update () | |
| { | |
| if (Input.GetMouseButtonDown(0)) | |
| { | |
| if (eventSystem.IsPointerOverGameObject()) return; | |
| // do other stuff, since not hitting UI | |
| } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment