Ejemplo n.º 1
0
        IEnumerator LoadDirectory(DirectoryInfo dir)
        {
            if (dir.Exists)
            {
                DirectoryInfo[] dirs = dir.GetDirectories().OrderByDescending(d => d.LastWriteTime).ToArray();
                for (int i = 0; i < items.Count; i++)
                {
                    UIImageGrid ug = items[i] as UIImageGrid;
                    if (!ug.EqualDirectory(dirs[i]))
                    {
                        ug.Load(dirs[i]);
                    }
                }
                if (items.Count < dirs.Length)
                {
                    for (int i = items.Count; i < dirs.Length; i++)
                    {
                        UIImageGrid grid = AddItem(dirs[i]);
                        if (grid != null)
                        {
                            yield return(new WaitUntil(grid.IsLoaded));

                            topPos -= grid.GetHeight() + spaceY;
                        }
                    }
                }
                topPos -= bottomRect.sizeDelta.y;
            }
            yield return(new WaitForEndOfFrame());

            Refresh();
        }
Ejemplo n.º 2
0
        public UIImageGrid GetItem(string path)
        {
            UIImageGrid grid = null;

            foreach (UIControl c in items)
            {
                grid = c as UIImageGrid;
                if (grid.EqualDirectory(path))
                {
                    return(grid);
                }
            }
            return(null);
        }