Beispiel #1
0
    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);
    }
Beispiel #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);
    }