3dContactPointAnnotationTool开发日志(三三)

  添加背景图片后发现Runtime Transform Gizmo无法选中物体了:

3dContactPointAnnotationTool开发日志(三三)

  于是改了一下EditorObjectSelection.cs中的WereAnyUIElementsHovered函数:

private bool WereAnyUIElementsHovered()
{
if (EventSystem.current == null) return false; Vector2 inputDevPos;
if (!InputDevice.Instance.GetPosition(out inputDevPos)) return false; PointerEventData eventDataCurrentPosition = new PointerEventData(EventSystem.current);
eventDataCurrentPosition.position = new Vector2(inputDevPos.x, inputDevPos.y); List<RaycastResult> results = new List<RaycastResult>();
EventSystem.current.RaycastAll(eventDataCurrentPosition, results);
//added by me
int cnt = results.Count;
foreach(var item in results)
{
if (item.gameObject.layer.Equals(Macro.BACKGROUND))
cnt--;
}
return cnt != 0;
//
//return results.Count != 0;
}

  然后可以正常点击物体了:

3dContactPointAnnotationTool开发日志(三三)

上一篇:SetSysColors 修改系统颜色


下一篇:logistic公式形式的由来,从广义线性回归说起