检测鼠标是否在UI上unity

public static bool IsCursorOnUI(int inputID=-1){
EventSystem eventSystem = EventSystem.current;
return ( eventSystem.IsPointerOverGameObject( inputID ) );
}

猜你喜欢

转载自www.cnblogs.com/mcyushao/p/9940579.html