【发布时间】:2018-03-07 15:15:15
【问题描述】:
如果不使用 TUIO 触摸和 UNITY 触摸,那么下面的函数会是什么样子?
/// Fingers touch.
/// </summary>
private void FingerTouch ()
{
var beganTouches = from Tuio.Touch t in TuioTrackingComponent.Touches.Values
where t.Status == TouchStatus.Began
select t;
// Raycast and attached springs to the hit objects
foreach (Tuio.Touch t in beganTouches) {
if (Physics.Raycast (Camera.main.ScreenPointToRay (new Vector3 (t.TouchPoint.x, t.TouchPoint.y, 0f)), out hit)) {
if (hit.collider != null && hit.transform.gameObject.CompareTag ("FishCollider")) {
touchedFishes.Add (t.TouchId, hit.transform.parent.gameObject);
isHolding = true;
}
}
MoveFish (t);
}
}
【问题讨论】: