Created
August 25, 2018 06:10
-
-
Save tsuzukihashi/91292eaf48595c625cb1391625eb4480 to your computer and use it in GitHub Desktop.
This file contains 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
//ボタンをタップした処理だけを実行するための関数 | |
private bool IsPointerOverUIObject() | |
{ | |
PointerEventData eventDataCurrentPosition = new PointerEventData(EventSystem.current); | |
eventDataCurrentPosition.position = new Vector2(Input.mousePosition.x, Input.mousePosition.y); | |
List<RaycastResult> results = new List<RaycastResult>(); | |
EventSystem.current.RaycastAll(eventDataCurrentPosition, results); | |
return results.Count > 0; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment