判断鼠标是否点击在UGUI上 #if UNITY_ANDROID && !UNITY_EDITOR #define ANDROID #endif #if UNITY_IPHONE && !UNITY_EDITOR #define IPHONE #endif using UnityEngine; using UnityEngine.UI; using System.Collections; using UnityEngine.EventSystems; public clas
EventSystem.current.IsPointerOverGameObject(); //返回一个布尔值,进入了UI上就返回true,用的时候要 using UnityEngine.EventSystems; 1.写一个脚本挂到相机上,如下: using System.Collections; using System.Collections.Generic; using UnityEngine; using UnityEngine.EventSystems; public class