public void NotifyCollisionStay(Collider collider, CollisionZone collisionZone) { Debug.Log("Collision Stay: " + collider + " from Left? " + collisionZone.isLeft + " Finger:" + collisionZone.finger); IDataSender sender; if (TryGetSender(collisionZone, out sender)) { DateTime[] timeouts; bool[] stopMessageSent; if (collisionZone.isLeft) { timeouts = _timeoutsLeft; stopMessageSent = _sentStopMessageLeft; } else { timeouts = _timeoutsRight; stopMessageSent = _sentStopMessageRight; } var finger = (int)collisionZone.finger; if (timeouts[finger] <= DateTime.Now || stopMessageSent[finger]) { sender.SendString(collisionZone.finger, Intensity); timeouts[finger] = DateTime.Now + _timeoutDelay; stopMessageSent[finger] = false; } } }
private bool TryGetSender(CollisionZone collisionZone, out IDataSender sender) { if (collisionZone.isLeft) { sender = _leftHand; return(_leftHandInitialized); } sender = _rightHand; return(_rightHandInitialized); }
public void NotifyCollisionExit(Collider collider, CollisionZone collisionZone) { }
public void NotifyCollisionEnter(Collider collider, CollisionZone collisionZone) { }