浏览代码

add EventSystem.current.IsPointerOverGameObject() check

/add_hero_sample
Xingwei Zhu 3 年前
当前提交
66ee6d51
共有 1 个文件被更改,包括 9 次插入0 次删除
  1. 9
      AwesomeUIWidgets/Assets/Scripts/RaycastableScene/DragRotate.cs

9
AwesomeUIWidgets/Assets/Scripts/RaycastableScene/DragRotate.cs


void OnMouseDown()
{
if (EventSystem.current.IsPointerOverGameObject())
{
return;
}
_lastPosition = mousePosition;
}

private void OnMouseDrag()
{
if (_lastPosition == null)
{
return;
}
Vector2 direction = mousePosition - _lastPosition.Value;
_lastPosition = mousePosition;

正在加载...
取消
保存