Esempio n. 1
0
 // 鼠标左键在窗口内放开
 public virtual void onMouseUp(Vector3 mousePos)
 {
     mPressCallback?.Invoke(this, false);
     if (lengthLess(mMouseDownPosition - mousePos, FrameDefine.CLICK_THRESHOLD))
     {
         mClickCallback?.Invoke(this);
     }
     mOnMouseUp?.Invoke(mousePos);
 }
Esempio n. 2
0
 // 鼠标左键在窗口内放开
 public virtual void onMouseUp(Vector3 mousePos)
 {
     mPressing    = false;
     mPressedTime = -1.0f;
     mPressCallback?.Invoke(this, false);
     if (lengthLess(mMouseDownPosition - mousePos, CommonDefine.CLICK_THRESHOLD))
     {
         mObjectPreClickCallback?.Invoke(this, mObjectPreClickCallbackUserData);
         mClickCallback?.Invoke(this);
         if (mDoubleClickCallback != null && mLastClickTime > 0.0f && mLastClickTime < CommonDefine.DOUBLE_CLICK_THRESHOLD)
         {
             mDoubleClickCallback(this);
             // 已完成双击操作,结束计时
             mLastClickTime = -1.0f;
         }
         // 未开始双击计时则开始计时
         if (mLastClickTime < 0.0f)
         {
             mLastClickTime = 0.0f;
         }
     }
     mOnMouseUp?.Invoke(mousePos);
     mOnLongPressing?.Invoke(0.0f);
 }