void CallListener(TouchCursor t) { t.ResetUsed(); foreach (ICommonTouchListener l in listeners) { l.TouchChange(t); } }
void MoveTouch(Touch t) { if (touchCursors.ContainsKey(t.fingerId)) { TouchCursor c = touchCursors[t.fingerId]; c.phase = t.phase; c.ray = FindTouchRay(t); } }
void MoveTouch(Touch t) { if (touchCursors.ContainsKey(t.fingerId)) { TouchCursor c = touchCursors[t.fingerId]; c.phase = t.phase; c.pos = FindTouchPoint(t); player.Move(c.pos, c.fingerId); } }
void NewTouch(Touch t) { int index = t.fingerId; TouchCursor c = new TouchCursor(t, FindTouchRay(t)); touchCursors[index] = c; //Instantiate(cursor, FindTouchPoint(t), Quaternion.identity); }
void MoveTouch(Touch t) { if (touchCursors.ContainsKey(t.fingerId)) { TouchCursor c = touchCursors[t.fingerId]; c.phase = TouchCursor.Phase.Move; c.ray = FindTouchRay(t); CallListener(c); c.CallListener(); } }
void NewTouch(Touch t) { int index = t.fingerId; TouchCursor c = new TouchCursor(t, FindTouchRay(t)); touchCursors[index] = c; c.phase = TouchCursor.Phase.Down; CallListener(c); c.CallListener(); }
public void TapEnded() { tap = false; targetInteractable = null; targetingInteractable = false; targetCollider = null; if (touchCursor != null) { touchCursor.endTouch(); touchCursor = null; } da_Rigidbody.velocity = Vector2.zero; }
void NewTouch(Touch t) { int index = t.fingerId; TouchCursor c = new TouchCursor(t, FindTouchPoint(t)); touchCursors[index] = c; if (touchCursors.Count == 1) { player.Move(c.pos, index); } //Instantiate(cursor, FindTouchPoint(t), Quaternion.identity); }
//Tap detected without validity checking, added interactable targeting public void OnTap(Vector3 position) { if (canMove) { if (tap) { TapEnded(); } targetPosition = position; tap = true; MoveTowards(targetPosition); touchCursor = Instantiate(touchInputManager.touchCursorPrefab).GetComponent <TouchCursor>(); touchCursor.changePosition(targetPosition); //Needs pathfinding } }
// Use this for initialization void Start() { cursor = GetComponent <TouchCursor>(); prevPos = transform.position; col = GetComponent <CircleCollider2D>(); }