浏览代码

remove ifdef and check for touch always

/4.1
Alexandra Serralta 4 年前
当前提交
ea336405
共有 1 个文件被更改,包括 7 次插入9 次删除
  1. 16
      Assets/Scripts/PlaceOnPlane.cs

16
Assets/Scripts/PlaceOnPlane.cs


bool TryGetTouchPosition(out Vector2 touchPosition)
{
#if UNITY_EDITOR
if (Input.GetMouseButton(0))
if (Input.touchCount > 0)
var mousePosition = Input.mousePosition;
touchPosition = new Vector2(mousePosition.x, mousePosition.y);
touchPosition = Input.GetTouch(0).position;
#else
if (Input.touchCount > 0)
else if (Input.GetMouseButton(0))
touchPosition = Input.GetTouch(0).position;
var mousePosition = Input.mousePosition;
touchPosition = new Vector2(mousePosition.x, mousePosition.y);
#endif
touchPosition = default;
return false;

ARRaycastManager m_RaycastManager;
}
}
}
正在加载...
取消
保存