Ejemplo n.º 1
0
 private int GetIndexOfFirstMapItem(Vector2 pixelPosition)
 {
     for (int i = 0; i < items.Count; i++)
     {
         if (RectBox.StaticRectBox(Camera.main.WorldToScreenPoint(items[i].rectTransform.position),
                                   items[i].rectTransform.sizeDelta.x, items[i].rectTransform.sizeDelta.y).IsPointInBox(pixelPosition))
         {
             return(i);
         }
     }
     return(-1);
 }