public void OnTouchMoved(KZTouchEvent e) { Vector3 currentPosition = e.touch.position; Vector3 screenPivot = Camera.main.WorldToScreenPoint(pivot); float currentAngle = GetAngle (currentPosition - screenPivot); float lastAngle = GetAngle (lastPosition - screenPivot); transform.RotateAround(pivot,Vector3.forward,currentAngle-lastAngle); lastPosition = currentPosition; }
public void OnTouchBegan(KZTouchEvent e) { toucher++; //[ >>> the object will be locked in a plan // parallel to camera's near clip plane, with // a distance of "distance". distance = (e.current.transform.position - e.camera.transform.position).magnitude; last=ScreenToWorld(e.touch.position, e.camera); }
public void TouchEnded(KZTouchEvent e) { toucher--; }
public void OnTouchMoved(KZTouchEvent e) { if(toucher>0) { Drag(e.touch, e.camera); } }
public void OnTouchBegan(KZTouchEvent e) { toucher++; }
public void TouchEnded(KZTouchEvent e) { toucher--; last=Vector3.zero; distance = 0; }
public void OnTouchStayed(KZTouchEvent t) { listeners.ForEach(x => KZUtil.Call(x, "OnTouchStayed", t)); }
public void OnTouchBegan(KZTouchEvent t) { listeners.ForEach(x => KZUtil.Call(x, "OnTouchBegan", t)); }
public void OnTouchBegan(KZTouchEvent e) { lastPosition = e.touch.position; }