void CallListener(TouchCursor t)
 {
     t.ResetUsed();
     foreach (ICommonTouchListener l in listeners)
     {
         l.TouchChange(t);
     }
 }
Пример #2
0
 void MoveTouch(Touch t)
 {
     if (touchCursors.ContainsKey(t.fingerId))
     {
         TouchCursor c = touchCursors[t.fingerId];
         c.phase = t.phase;
         c.ray   = FindTouchRay(t);
     }
 }
Пример #3
0
 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);
     }
 }
Пример #4
0
    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();
    }
Пример #7
0
 public void TapEnded()
 {
     tap = false;
     targetInteractable    = null;
     targetingInteractable = false;
     targetCollider        = null;
     if (touchCursor != null)
     {
         touchCursor.endTouch();
         touchCursor = null;
     }
     da_Rigidbody.velocity = Vector2.zero;
 }
Пример #8
0
    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);
    }
Пример #9
0
    //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
        }
    }
Пример #10
0
 // Use this for initialization
 void Start()
 {
     cursor  = GetComponent <TouchCursor>();
     prevPos = transform.position;
     col     = GetComponent <CircleCollider2D>();
 }