示例#1
0
 private void OnStartedHold(InputCursorInfo ici)
 {
     if (!ici.startedOverUI)
     {
         onStartedHold?.Invoke(ici);
     }
 }
示例#2
0
 private void OnMouseMoved(InputCursorInfo ici)
 {
     if (!ici.startedOverUI)
     {
         onMouseMoved?.Invoke(ici);
     }
 }
示例#3
0
 private void OnDragged(InputCursorInfo ici)
 {
     if (!ici.startedOverUI)
     {
         onDragged?.Invoke(ici);
     }
 }
示例#4
0
 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;
 }
示例#5
0
 void OnTap(InputCursorInfo info)
 {
     //如果点击到UI上 则这个事件会被inputfilter拦截 可以尝试一下
     Debug.Log("点击了屏幕的(" + info.currentPosition.x + "," + info.currentPosition.y + ")");
 }