/// 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); } }
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; } } }
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); } } } }
public void UnsubscribeEvents(SensoHand hand) { hand.OnPinchStart -= onPitchStart; hand.OnPinchEnd -= onPitchEnd; }
// Senso! public void SubscribeEvents(SensoHand hand) { hand.OnPinchStart += onPitchStart; hand.OnPinchEnd += onPitchEnd; }
public void SetHand(SensoHand aHand) { m_hand = new WeakReference(aHand); }