public void LoadAsset() { Debug.Log("Requesting asset..."); // PolyApi.GetAsset("assets/5vbJ5vildOq", GetAssetCallback); PolyApi.ListAssets(PolyListAssetsRequest.Featured(), OnAssetListReturned); // statusText.text = "Requesting..."; }
public AssetBrowserManager() { PtDebug.Log("ABM initializing..."); EnsurePolyIsReady(); // Initially, show the featured assets home page. StartRequest(PolyListAssetsRequest.Featured()); }
private void Start() { //Initialize page = 0; req = new PolyListAssetsRequest(); //Get Featured Models PolyApi.ListAssets(PolyListAssetsRequest.Featured(), LoadModels); }
public void LoadAssets() { PolyListAssetsRequest polyRequest = PolyListAssetsRequest.Featured(); polyRequest.pageSize = pageSize; polyRequest.curated = true; polyRequest.orderBy = PolyOrderBy.BEST; polyRequest.pageToken = pageination; PolyApi.ListAssets(polyRequest, LoadAssetsCallback); }
void Start() { m_cameraTransform = GameObject.FindWithTag("MainCamera").transform; asset_id_name_list = new List <KeyValuePair <string, string> >(); asset_thumbnail_list = new List <KeyValuePair <string, Texture2D> >(); Debug.Log("Requesting List of Assets..."); // list featured assets PolyApi.ListAssets(PolyListAssetsRequest.Featured(), FeaturedAssetListCallback); //PolyAssetSearchQuery(searchKeyword); }
//////////////////////////////////////// // // List Assets public void ListAssets(int count, Action <List <PolyAsset> > callback) { PolyListAssetsRequest request = PolyListAssetsRequest.Featured(); request.maxComplexity = PolyMaxComplexityFilter.SIMPLE; request.pageSize = count; PolyApi.ListAssets(request, (result) => { OnAssetsListed(result, callback); }); }
private void CmdList(string[] args) { PolyListAssetsRequest req; if (args.Length > 0 && args[0] == "featured") { // Default list request (featured). req = PolyListAssetsRequest.Featured(); } else if (args.Length > 0 && args[0] == "latest") { // Default list request (latest). req = PolyListAssetsRequest.Latest(); } else { // Custom list request. req = new PolyListAssetsRequest(); } // Mutate the request according to parameters. req.category = GetEnumOpt(args, "-c", req.category); req.curated = HasOpt(args, "-k") ? true : req.curated; req.keywords = GetOpt(args, "-s", req.keywords); req.maxComplexity = GetEnumOpt(args, "--maxc", req.maxComplexity); req.orderBy = GetEnumOpt(args, "-o", req.orderBy); req.pageSize = GetIntOpt(args, "-p", req.pageSize); req.pageToken = GetOpt(args, "--pt", req.pageToken); // FormatFilter is weird because it's nullable, so we have to test before trying to parse: if (HasOpt(args, "-f")) { req.formatFilter = GetEnumOpt(args, "-f", PolyFormatFilter.BLOCKS /* not used */); } if (HasOpt(args, "--dry")) { // Dry run mode. PrintLn(req.ToString()); return; } // Send the request. hasRunListCommand = true; PrintLn("Sending list request... Please wait."); PolyApi.ListAssets(req, (PolyStatusOr <PolyListAssetsResult> res) => { if (!res.Ok) { PrintLn("Request ERROR: " + res.Status); return; } currentResults = res.Value.assets; CmdShow(new string[] {}); }); }
private void Start() { // Request a list of featured assets from Poly. Debug.Log("Getting featured assets..."); statusText.text = "Requesting..."; PolyListAssetsRequest request = PolyListAssetsRequest.Featured(); // Limit requested models to those of medium complexity or lower. request.maxComplexity = PolyMaxComplexityFilter.MEDIUM; PolyApi.ListAssets(request, ListAssetsCallback); }
// move to new class? (e.g. pallette manager) private void GetPaletteThumbnails() { // display featured asset thumbnais Debug.Log("Getting featured asset thumbnails..."); statusText.text = "Requesting..."; PolyListAssetsRequest request = PolyListAssetsRequest.Featured(); // Limit requested models to those of medium complexity or lower. request.maxComplexity = PolyMaxComplexityFilter.MEDIUM; PolyApi.ListAssets(request, ListAssetsCallback); // setup add asset buttons button1.onClick.AddListener(delegate { ImportAsset(0); }); button2.onClick.AddListener(delegate { ImportAsset(1); }); button3.onClick.AddListener(delegate { ImportAsset(2); }); button4.onClick.AddListener(delegate { ImportAsset(3); }); }
void StartDownload() { Debug.Log("Getting featured assets..."); if (_statusText != null) { _statusText.text = "Requesting..."; } didCompleteRequest = false; PolyListAssetsRequest request = PolyListAssetsRequest.Featured(); // Limit requested models to those of medium complexity or lower. request.maxComplexity = PolyMaxComplexityFilter.SIMPLE; PolyApi.ListAssets(request, ListAssetsCallback); Invoke("CheckTimeout", 10f); }
public void getInitialAssets(bool isPoly) { polyDescription = isPoly; FirebaseHandler firebaseHandler = FindObjectOfType <FirebaseHandler>(); m_cameraTransform = GameObject.FindWithTag("MainCamera").transform; asset_id_name_list = new List <KeyValuePair <string, string> >(); asset_thumbnail_list = new List <KeyValuePair <string, Texture2D> >(); // list featured assets if (isPoly) { PolyApi.ListAssets(PolyListAssetsRequest.Featured(), FeaturedAssetListCallback); } else { firebaseHandler.getElements(HandleFirebaseObjects); } }
public void onCategorySelected(string category) { Debug.Log(category + "::::" + PolyCategory.TRANSPORT); PolyListAssetsRequest req = new PolyListAssetsRequest(); // Search by keyword: req.category = PolyCategory.OBJECTS; //req.keywords = "tree"; // Only curated assets: req.curated = true; // Limit complexity to medium. req.maxComplexity = PolyMaxComplexityFilter.MEDIUM; // Only Blocks objects. req.formatFilter = PolyFormatFilter.BLOCKS; // Order from best to worst. req.orderBy = PolyOrderBy.BEST; // Up to 20 results per page. //req.pageSize = 20; PolyApi.ListAssets(PolyListAssetsRequest.Featured(), CallListAssetsCallbackEvent); }
public void onButtonClick() { PolyApi.ListAssets(PolyListAssetsRequest.Featured(), InitialiseUIContent); }
public void onListAssetsButtonClicked() { PolyApi.ListAssets(PolyListAssetsRequest.Featured(), CallListAssetsCallbackEvent); }