Example #1
0
        private void SingleHandGestureEvent(HandsGestureManager.HandGestureState state, Vector3 pos)
        {
            switch (state)
            {
            case HandsGestureManager.HandGestureState.DragStart:
                if (focusflag)
                {
                    starthand = pos;
                    startpos  = transform.position;
                    dragflag  = true;
                }
                break;

            case HandsGestureManager.HandGestureState.Drag:
                if (dragflag)
                {
                    Vector3 move = pos - starthand;
                    transform.position = startpos + MoveScale * move;
                    if (LookAt)
                    {
                        transform.LookAt(Camera.main.transform.position);
                    }
                }
                break;
            }
        }
Example #2
0
 private void HandGestureEvent(HandsGestureManager.HandGestureState state)
 {
     if (state == ActionState && focusflag)
     {
         TapActionEvent.Invoke();
     }
 }
Example #3
0
 private void HandGestureEvent(HandsGestureManager.HandGestureState state)
 {
     if (state == HandsGestureManager.HandGestureState.Release)
     {
         dragflag = false;
     }
 }
Example #4
0
 private void HandGestureUpdateEvent(HandsGestureManager.HandGestureState state, Vector3 pos1, Vector3?pos2)
 {
     if (state == ActionState && dragflag)
     {
         DragUpdateActionEvent.Invoke(pos1, pos2);
     }
 }
        private void MultiHandGestureEvent(HandsGestureManager.HandGestureState state, Vector3 pos1, Vector3 pos2)
        {
            switch (state)
            {
            case HandsGestureManager.HandGestureState.MultiDragStart:
                if (focusflag)
                {
                    startdistance = Vector3.Distance(pos1, pos2);
                    startscale    = transform.localScale;
                    dragflag      = true;
                }
                break;

            case HandsGestureManager.HandGestureState.MultiDrag:
                if (dragflag)
                {
                    float scaleX = startscale.x;
                    float scaleY = startscale.y;
                    float scaleZ = startscale.z;
                    if (X)
                    {
                        scaleX = startscale.x + (Vector3.Distance(pos1, pos2) - startdistance) * Scale;
                    }
                    if (Y)
                    {
                        scaleY = startscale.y + (Vector3.Distance(pos1, pos2) - startdistance) * Scale;
                    }
                    if (Z)
                    {
                        scaleZ = startscale.z + (Vector3.Distance(pos1, pos2) - startdistance) * Scale;
                    }
                    if (scaleX < MinScale * initscale.x)
                    {
                        scaleX = MinScale * initscale.x;
                    }
                    else if (scaleX > MaxScale * initscale.x)
                    {
                        scaleX = MaxScale * initscale.x;
                    }
                    if (scaleY < MinScale * initscale.y)
                    {
                        scaleY = MinScale * initscale.y;
                    }
                    else if (scaleY > MaxScale * initscale.y)
                    {
                        scaleY = MaxScale * initscale.y;
                    }
                    if (scaleZ < MinScale * initscale.z)
                    {
                        scaleZ = MinScale * initscale.z;
                    }
                    else if (scaleZ > MaxScale * initscale.z)
                    {
                        scaleZ = MaxScale * initscale.z;
                    }
                    transform.localScale = new Vector3(scaleX, scaleY, scaleZ);
                }
                break;
            }
        }
Example #6
0
        private void SingleHandGestureEvent(HandsGestureManager.HandGestureState state, Vector3 pos)
        {
            switch (state)
            {
            case HandsGestureManager.HandGestureState.ShiftDragStart:
                if (focusflag)
                {
                    starthand = Camera.main.transform.TransformPoint(pos);
                    startrot  = transform.rotation;
                    dragflag  = true;
                }
                break;

            case HandsGestureManager.HandGestureState.ShiftDrag:
                if (dragflag)
                {
                    Vector3 move = Camera.main.transform.TransformPoint(pos) - starthand;
                    if (X)
                    {
                        transform.rotation = startrot * Quaternion.AngleAxis(move.y * RotationScale * 10.0f, transform.right);
                    }
                    if (Y)
                    {
                        transform.rotation = startrot * Quaternion.AngleAxis(-move.x * RotationScale * 10.0f, transform.up);
                    }
                    if (Z)
                    {
                        transform.rotation = startrot * Quaternion.AngleAxis(-move.z * RotationScale * 10.0f, transform.forward);
                    }
                }
                break;
            }
        }
Example #7
0
 private void HandGestureStartEvent(HandsGestureManager.HandGestureState state, Vector3 pos1, Vector3?pos2)
 {
     if (state == ActionState && focusflag)
     {
         DragStartActionEvent.Invoke(pos1, pos2);
         dragflag = true;
     }
 }
Example #8
0
 private void HandGestureEvent(HandsGestureManager.HandGestureState state)
 {
     if (state == HandsGestureManager.HandGestureState.DoubleTap && focusflag == true)
     {
         tapflag = true;
         isPlay  = !isPlay;
         SetPlay(isPlay);
     }
 }
        private void ViewGestureLog(HandsGestureManager.HandGestureState state)
        {
            switch (state)
            {
            case HandsGestureManager.HandGestureState.Tap:
                Debug.Log("Tap");
                break;

            case HandsGestureManager.HandGestureState.DoubleTap:
                Debug.Log("DoubleTap");
                break;

            case HandsGestureManager.HandGestureState.Hold:
                Debug.Log("Hold");
                break;

            case HandsGestureManager.HandGestureState.DragStart:
                Debug.Log("DragStart");
                break;

            case HandsGestureManager.HandGestureState.ShiftTap:
                Debug.Log("ShiftTap");
                break;

            case HandsGestureManager.HandGestureState.ShiftDoubleTap:
                Debug.Log("ShiftDoubleTap");
                break;

            case HandsGestureManager.HandGestureState.ShiftHold:
                Debug.Log("ShiftHold");
                break;

            case HandsGestureManager.HandGestureState.ShiftDragStart:
                Debug.Log("ShiftDragStart");
                break;

            case HandsGestureManager.HandGestureState.MultiTap:
                Debug.Log("MultiTap");
                break;

            case HandsGestureManager.HandGestureState.MultiDoubleTap:
                Debug.Log("MultiDoubleTap");
                break;

            case HandsGestureManager.HandGestureState.MultiDragStart:
                Debug.Log("MultiDragStart");
                break;
            }
        }
Example #10
0
 private void HandGestureEvent(HandsGestureManager.HandGestureState state)
 {
     if (state == HandsGestureManager.HandGestureState.ShiftHold)
     {
         importexpot.ImportTransform();
     }
     else if (state == HandsGestureManager.HandGestureState.ShiftDoubleTap)
     {
         transform.position = Camera.main.transform.position;
         transform.LookAt(Camera.main.transform.position + Camera.main.transform.forward);
     }
     else if (state == HandsGestureManager.HandGestureState.MultiDoubleTap)
     {
         importexpot.ExportTransform();
     }
 }
Example #11
0
 private void HandGestureStartEvent(HandsGestureManager.HandGestureState state, Vector3 pos1, Vector3?pos2)
 {
     Debug.Log(HandGestureName[(int)state]);
 }
Example #12
0
 private void HandGestureEvent(HandsGestureManager.HandGestureState state)
 {
     Debug.Log(HandGestureName[(int)state]);
 }
Example #13
0
 private void MultiHandGestureEvent(HandsGestureManager.HandGestureState state, Vector3 pos1, Vector3 pos2)
 {
     ViewGestureLog(state);
 }
Example #14
0
 private void SingleHandGestureEvent(HandsGestureManager.HandGestureState state, Vector3 pos)
 {
     ViewGestureLog(state);
 }
Example #15
0
 private void HandGestureEvent(HandsGestureManager.HandGestureState state)
 {
     ViewGestureLog(state);
 }