Ejemplo n.º 1
0
    private void GetThumbnail()
    {
        var url = sceneAssetPack?.ComposeThumbnailUrl();

        if (url == loadedThumbnailURL)
        {
            return;
        }

        if (sceneAssetPack == null || string.IsNullOrEmpty(url))
        {
            return;
        }

        string newLoadedThumbnailURL     = url;
        var    newLoadedThumbnailPromise = new AssetPromise_Texture(url);


        newLoadedThumbnailPromise.OnSuccessEvent += SetThumbnail;
        newLoadedThumbnailPromise.OnFailEvent    += x => { Debug.Log($"Error downloading: {url}"); };

        AssetPromiseKeeper_Texture.i.Keep(newLoadedThumbnailPromise);


        AssetPromiseKeeper_Texture.i.Forget(loadedThumbnailPromise);
        loadedThumbnailPromise = newLoadedThumbnailPromise;
        loadedThumbnailURL     = newLoadedThumbnailURL;
    }
Ejemplo n.º 2
0
    public static CatalogItemPack CreateCatalogItemPack(SceneAssetPack sceneAssetPack)
    {
        CatalogItemPack catalogItemPack = new CatalogItemPack();

        catalogItemPack.id    = sceneAssetPack.id;
        catalogItemPack.title = sceneAssetPack.title;

        catalogItemPack.assets = new List <CatalogItem>();

        catalogItemPack.SetThumbnailULR(sceneAssetPack.ComposeThumbnailUrl());

        foreach (SceneObject sceneObject in sceneAssetPack.assets)
        {
            catalogItemPack.assets.Add(CreateCatalogItem(sceneObject));
        }

        return(catalogItemPack);
    }
Ejemplo n.º 3
0
    public static CatalogItemPack CreateCatalogItemPack(SceneAssetPack sceneAssetPack)
    {
        CatalogItemPack catalogItemPack = new CatalogItemPack();

        catalogItemPack.id    = sceneAssetPack.id;
        catalogItemPack.title = sceneAssetPack.title;

        catalogItemPack.assets = new List <CatalogItem>();

        catalogItemPack.SetThumbnailULR(sceneAssetPack.ComposeThumbnailUrl());

        foreach (SceneObject sceneObject in sceneAssetPack.assets)
        {
            //TODO: SmartItems disabled until kernel has them implemented
            if (!sceneObject.IsSmartItem())
            {
                catalogItemPack.assets.Add(CreateCatalogItem(sceneObject));
            }
        }

        return(catalogItemPack);
    }