Beispiel #1
0
    public void onIndexFingerMoved(object finger, FingerMovedArgs args)
    {
        // Debug.Log("finger moved: " + args.deltaMove.y);
        var dy  = args.deltaMove.y;
        var abs = Mathf.Abs(dy);

        if (abs > 0.001f && abs < FingerMoveMax)
        {
            if (dy < -FingerMoveMax)
            {
                return;                                  //dy = -FingerMoveMax;
            }
            else if (dy > FingerMoveMax)
            {
                return;                                      //dy = FingerMoveMax;
            }
            scrollRect.verticalNormalizedPosition += dy;
        }
    }
Beispiel #2
0
 // Update is called once per frame
 void FixedUpdate()
 {
     if (isVibrating)
     {
         var diff = DateTime.Now.Subtract(lastSent);
         if (diff.Milliseconds * 1000 + diff.Milliseconds > 300)
         {
             m_netMan.VibrateFinger(m_handType, (byte)fingerId, m_vibrateStrength);
             lastSent = DateTime.Now;
         }
     }
     if (m_moveSubscribed > 0)
     {
         Vector3 deltaPos = transform.position - m_lastPosition;
         var     arg      = new FingerMovedArgs(deltaPos);
         onMove(this, arg);
         m_lastPosition = transform.position;
     }
 }