我一直在玩 UIToolkit,它很棒。虽然我的点击通过按钮,所以当点击 UI 时,我的光线投射也开始了。有没有办法检查 GUI 上是否有点击/触摸?
编辑:我正在使用 Prime31 的 UIToolkit
解决了:
foreach (var touchable in _gui.touchableSprites) {
if ( !touchable.hidden && touchable.hitTest(new Vector2(clickPos.x, Screen.height - clickPos.y)) ) return;
}
谢谢。