コード例 #1
0
    void MoveTouchBall(Touch t)
    {
        int       index = t.fingerId;
        TouchBall b     = touchBalls[index];

        b.phase = t.phase;
        b.gameObject.transform.position = FindTouchPoint(t);
    }
コード例 #2
0
 void OnPressed(TouchBall b)
 {
     if (touch == -1)
     {
         touch = b.fingerId;
         animator.Play("hold");
     }
     //Debug.Log(touch);
 }
コード例 #3
0
    void RemoveTouchBall(Touch t)
    {
        int       index = t.fingerId;
        TouchBall b     = touchBalls[index];

        b.phase = t.phase;
        touchBalls.Remove(index);
        Destroy(b.gameObject, 0.1f);
    }
コード例 #4
0
 void OnReleased(TouchBall b)
 {
     if (touch == b.fingerId)
     {
         animator.Play("idle");
         damage = 0f;
         touch  = -1;
     }
     //Debug.Log(touch);
     //Debug.Log(b.fingerId);
 }
コード例 #5
0
    void NewTouchBall(Touch t)
    {
        int index = t.fingerId;

        TouchBall b = Instantiate(sampleTouchBall, FindTouchPoint(t), Quaternion.identity).GetComponent <TouchBall>();

        b.Size            = touchSize;
        b.phase           = t.phase;
        b.fingerId        = index;
        touchBalls[index] = b;
    }