GetMouseButtonDownメソッドを使ってマウスの入力を取得していると、uGUIのボタンを押したときにも画面クリックを検出してしまいます。 ボタンがタッチされたときは、画面のタッチは無視する これでも良い場合もありますが、普通は画面のクリックとボタンのクリックは分離したいですよね〜。 そんなときはEventSystemのIsPointerOverGameObjectメソッドを使います。このメソッドは、ボタンがクリックされたときにだけ反応するので、簡単に画面クリックを無視することが出来ます。 スクリプトは次のようになります。 using System.Collections; using System.Collections.Generic; using UnityEngine; using UnityEngine.EventSystems; public class TouchC