Ejemplo n.º 1
0
 public override void Refresh()
 {
     topPos = -spaceY;
     for (int i = items.Count - 1; i > -1; i--)
     {
         ((UIImageGrid)items[i]).Refresh();
     }
     for (int i = 0; i < items.Count; i++)
     {
         UIImageGrid _grid = items[i] as UIImageGrid;
         _grid.SetPosY(topPos);
         topPos -= _grid.GetHeight() + spaceY;
     }
     topPos -= bottomRect.sizeDelta.y;
     UpdateSize();
 }
Ejemplo n.º 2
0
        public UIImageGrid AddItem(DirectoryInfo dir, int index = -1)
        {
            GameObject  obj  = Instantiate(gridPrefab, contentRect);
            UIImageGrid grid = obj.GetComponent <UIImageGrid>();

            grid.SetPosY(topPos);
            grid.Load(dir);
            grid.ItemClickedHandler = OnClickImage;
            if (index != -1)
            {
                Items.Insert(index, grid);
                obj.transform.SetSiblingIndex(index);
            }
            grid.Parent = this;
            return(grid);
        }