예제 #1
0
    /// Events
    public void fingerPinch(ESensoPositionType handType, ESensoFingerType finger1Type, ESensoFingerType finger2Type, bool stop = false)
    {
        SensoHand aHand = null;

        foreach (var hand in sensoHands)
        {
            if (hand.HandType == handType)
            {
                aHand = hand;
                break;
            }
        }

        if (aHand != null)
        {
            aHand.TriggerPinch(finger1Type, finger2Type, stop);
        }
    }
예제 #2
0
    void OnTriggerExit(Collider other)
    {
        var palm = other.gameObject.GetComponent <SensoPalm>();

        if (palm != null)
        {
            var h = palm.Hand;
            if (h != null && h == m_handAttached)
            {
                if (m_handAttached != null)
                {
                    m_handAttached.OnGrabStart -= onGrabStart;
                    m_handAttached.OnGrabEnd   -= onGrabEnd;
                }
                if (m_attached)
                {
                    do_detach();
                }
                m_handAttached.ToggleVibrateAll(0);
                m_handAttached = null;
            }
        }
    }
예제 #3
0
 void OnTriggerEnter(Collider other)
 {
     if (m_handAttached == null)
     {
         var palm = other.gameObject.GetComponent <SensoPalm>();
         if (palm != null)
         {
             m_handAttached = palm.Hand;
             if (m_handAttached != null)
             {
                 m_handAttached.OnGrabStart += onGrabStart;
                 m_handAttached.OnGrabEnd   += onGrabEnd;
             }
             if (m_handAttached.Grabbing)
             {
                 do_attach();
             }
             else
             {
                 m_handAttached.ToggleVibrateAll(2);
             }
         }
     }
 }
예제 #4
0
 public void UnsubscribeEvents(SensoHand hand)
 {
     hand.OnPinchStart -= onPitchStart;
     hand.OnPinchEnd   -= onPitchEnd;
 }
예제 #5
0
 // Senso!
 public void SubscribeEvents(SensoHand hand)
 {
     hand.OnPinchStart += onPitchStart;
     hand.OnPinchEnd   += onPitchEnd;
 }
예제 #6
0
 public void SetHand(SensoHand aHand)
 {
     m_hand = new WeakReference(aHand);
 }