示例#1
0
        public void RequestAssetList()
        {
#if INCLUDE_POLY_TOOLKIT
            var nextPageToken = m_NextPageToken;
            m_NextPageToken = null;

            if (m_Sorting != sorting || m_Complexity != complexity || m_Format != format || m_Category != category)
            {
                nextPageToken = null;
                foreach (var asset in data)
                {
                    RecycleGridItem(asset);
                }

                data.Clear();
                m_LastHiddenItemOffset = Mathf.Infinity;
            }

            m_Sorting    = sorting;
            m_Complexity = complexity;
            m_Format     = format;
            m_Category   = category;
            this.GetAssetList(sorting, complexity, format, category, k_RequestSize, data, SetNextPageToken, nextPageToken);
#endif
        }
示例#2
0
        /// <summary>
        /// Get a list of assets
        /// </summary>
        /// <param name="user">The functionality user</param>
        /// <param name="orderBy">The sorting order of the results</param>
        /// <param name="complexity">The max complexity of assets to request</param>
        /// <param name="format">The format of assets to request</param>
        /// <param name="category">The category of assets to request</param>
        /// <param name="requestSize">The number of assets to request</param>
        /// <param name="assets">The list of poly assets to add the results to</param>
        /// <param name="listCallback">A method which is called when the list is returned</param>
        /// <param name="nextPageToken">(optional) The next page token to pick up on an existing list</param>
        public static void GetAssetList(this IUsesPoly user, PolyOrderBy orderBy, PolyMaxComplexityFilter complexity,
                                        PolyFormatFilter?format, PolyCategory category, int requestSize, List <PolyGridAsset>
                                        assets, Action <string> listCallback, string nextPageToken = null)
        {
#if !FI_AUTOFILL
            user.provider.GetAssetList(orderBy, complexity, format, category, requestSize, assets, listCallback, nextPageToken);
#endif
        }
示例#3
0
            public RequestHandler(PolyOrderBy orderBy, PolyMaxComplexityFilter complexity, PolyFormatFilter?format,
                                  PolyCategory category, int requestSize, List <PolyGridAsset> assets, Transform container,
                                  Action <string> listCallback, string nextPageToken = null)
            {
                m_Assets       = assets;
                m_Container    = container;
                m_ListCallback = listCallback;

                var request = new PolyListAssetsRequest
                {
                    orderBy       = orderBy,
                    maxComplexity = complexity,
                    formatFilter  = format,
                    category      = category
                };

                request.pageToken = nextPageToken;
                request.pageSize  = requestSize;
                PolyApi.ListAssets(request, ListAssetsCallback);
            }
示例#4
0
    public void SearchAPI()
    {
        if (searchField.text.Length > 0)
        {
            // Create a new request
            PolyListAssetsRequest request = new PolyListAssetsRequest();

            // Set request parameters
            request.keywords = searchField.text;
            request.pageSize = (int)(sizeSlider.value);

            PolyCategory category = (PolyCategory)categoryDropdown.value;
            request.category = category;

            PolyOrderBy order = (PolyOrderBy)orderDropdown.value;
            request.orderBy = order;

            // Make the request and pass result to callback function
            PolyApi.ListAssets(request, HandleResults);
        }
    }
示例#5
0
文件: IPoly.cs 项目: xxpniu/EditorXR
 /// <summary>
 /// Get a list of assets
 /// </summary>
 /// <param name="orderBy">The sorting order of the results</param>
 /// <param name="complexity">The max complexity of assets to request</param>
 /// <param name="format">The format of assets to request</param>
 /// <param name="category">The category of assets to request</param>
 /// <param name="requestSize">The number of assets to request</param>
 /// <param name="assets">The list of poly assets to add the results to</param>
 /// <param name="listCallback">A method which is called when the list is returned</param>
 /// <param name="nextPageToken">(optional) The next page token to pick up on an existing list</param>
 public static void GetAssetList(this IPoly obj, PolyOrderBy orderBy, PolyMaxComplexityFilter complexity,
                                 PolyFormatFilter?format, PolyCategory category, int requestSize, List <PolyGridAsset>
                                 assets, Action <string> listCallback, string nextPageToken = null)
 {
     getAssetList(orderBy, complexity, format, category, requestSize, assets, listCallback, nextPageToken);
 }
示例#6
0
 public void GetAssetList(PolyOrderBy orderBy, PolyMaxComplexityFilter complexity, PolyFormatFilter?format,
                          PolyCategory category, int requestSize, List <PolyGridAsset> assets, Action <string> listCallback,
                          string nextPageToken = null)
 {
     new RequestHandler(orderBy, complexity, format, category, requestSize, assets, m_Container, listCallback, this, nextPageToken);
 }