Example #1
0
 private void Update()
 {
     if (OVRInput.GetDown(OVRInput.Button.One))
     {
         rec.BeginRecording();
     }
     else if (OVRInput.GetUp(OVRInput.Button.One))
     {
         rec.EndRecording();
         rec.CheckRecognized();
     }
 }
Example #2
0
    void Update()
    {
        if (OVRInput.Get(OVRInput.Button.SecondaryHandTrigger))
        {
            positions.Clear();
            vels.Clear();
        }
        else
        {
            if (!started)
            {
                positions.Enqueue(rec.rightHand.position);
                if (positions.Count > 4)
                {
                    positions.Dequeue();
                }


                vels.Enqueue((rec.rightHand.position - lastPos).magnitude);
                lastPos = rec.rightHand.position;
                if (vels.Count > 4)
                {
                    vels.Dequeue();
                }

                if (Time.time - checkTime >= lastTime)
                {
                    lastTime = Time.time;
                    if (!PositionCheck())
                    {
                        rec.BeginRecording();
                        StartCoroutine(GestureStarted());
                    }
                }
            }
            else
            {
                positions.Clear();
                vels.Clear();
            }
        }
    }
    void Update()
    {
        if (Controller == null)
        {
            Debug.Log("Controller not initialized");
            return;
        }

        if (Controller.GetPressDown(triggerButton))
        {
            rec.BeginRecording();
        }
        if (Controller.GetPressUp(triggerButton))
        {
            rec.EndRecording();
        }
        if (Controller.GetPressDown(downPadButton))
        {
            rec.StoreGesture();
        }
    }