Exemplo n.º 1
0
    public void HandleMultiTouch(FTouch[] touches)
    {
        foreach (FTouch touch in touches)
        {
            if (touch.phase == TouchPhase.Began)
            {
                for (int i = thingies.Count - 1; i >= 0; i--)
                {
                    Thingy  thingy   = thingies[i];
                    FSprite sprite   = thingy.GetChildAt(0) as FSprite;
                    Vector2 touchPos = sprite.GlobalToLocal(touch.position);
                    Rect    rect     = sprite.textureRect;

                    if (rect.Contains(touchPos))
                    {
                        HandleGotThingy(thingy);
                        break;
                    }
                }
            }
        }
    }