浏览代码

refine input type detection logic

/main
xingwei.zhu 6 年前
当前提交
6412bf79
共有 1 个文件被更改,包括 6 次插入2 次删除
  1. 8
      Runtime/engine/input_utils.cs

8
Runtime/engine/input_utils.cs


}
static bool isTouchEvent(PointerEventData eventData) {
return !isMouseEvent(eventData);
//pointerId >= 0 : touches
//ref: https://docs.unity3d.com/ScriptReference/EventSystems.PointerEventData-pointerId.html
return eventData.pointerId >= 0;
return eventData.pointerId == -1;
//pointerId = -1, -2, -3 : mouse buttons
//ref: https://docs.unity3d.com/ScriptReference/EventSystems.PointerEventData-pointerId.html
return eventData.pointerId < 0;
}
}
}
正在加载...
取消
保存