예제 #1
0
파일: Gesture.cs 프로젝트: damned/textry-vr
    public void OnHandUpdate(IHand hand)
    {
        if (!hand.IsPresent())
        {
            HandNotNearKnob();
            return;
        }

        AddTrail(hand);

        var closest = knobs.FindClosestTo(hand.Centre());

        if (closest == null)
        {
            HandNotNearKnob();
            return;
        }

        HandNearKnob(closest);
    }
예제 #2
0
    public string OnHandUpdate(IHand hand)
    {
        if (!hand.IsPresent())
        {
            ReleaseAllKnobs();
            return(text);
        }
        debug.Log("hand position: " + hand.Centre());

        debug.Log("text: " + text);
        var closest = knobs.FindClosestTo(hand);

        // debug.Log("Closest: " + closest);
        if (closest == null)
        {
            HandleAwayFromKnobs();
            // debug.Log("Nearly grabbed things: " + string.Join(", ", close_things.ToList().Select(t => t.name).ToArray()));
            return(text);
        }

        HandleCloseToKnob(hand, closest);
        return(text);
    }