/* Build, builds carousel given a list of folders
     */
    public async void Build(List <Folder> folders)
    {
        if (folders == null)
        {
            return;
        }
        Active = false;
        Clear();

        int n = folders.Count;

        foreach (Folder folder in folders)
        {
            //Set texture.
            FolderImage image = MakeFolderImage();
            image.LoadThumbnailAsync(folder, () => {
                n--;
                if (n == 0)
                {
                    Active = true;
                    RunEvent("onload");
                }
            });

            //Add element.
            AddElement(image);
        }
    }
Пример #2
0
    public void Build(Variant variant)
    {
        if (variant == null)
        {
            return;
        }
        Active = false;
        Model model = variant.GetParent <Model>();

        Title.text = model.Name;
        Size.text  = variant.Name;
        Image.LoadThumbnailAsync(variant, () => {
            Active = true;
            RunEvent("onload");
        });
    }