private void OnStartedHold(InputCursorInfo ici) { if (!ici.startedOverUI) { onStartedHold?.Invoke(ici); } }
private void OnMouseMoved(InputCursorInfo ici) { if (!ici.startedOverUI) { onMouseMoved?.Invoke(ici); } }
private void OnDragged(InputCursorInfo ici) { if (!ici.startedOverUI) { onDragged?.Invoke(ici); } }
public event Action <InputWheelInfo> onSpunWheel; //鼠标滑轮事件 public void Init() { currentState = EnumUIState.Enable; // 光标是否初始化 if (Input.mousePresent) { mouseInfos = new InputMouseButtonInfo[trackMouseButtons]; cursorInfo = new InputCursorInfo { currentPosition = Input.mousePosition }; for (int i = 0; i < mouseInfos.Length; ++i) { mouseInfos[i] = new InputMouseButtonInfo { mouseButtonId = i, currentPosition = Input.mousePosition }; } } //UnityInput.simulateMouseWithTouches = false; }
void OnTap(InputCursorInfo info) { //如果点击到UI上 则这个事件会被inputfilter拦截 可以尝试一下 Debug.Log("点击了屏幕的(" + info.currentPosition.x + "," + info.currentPosition.y + ")"); }