Beispiel #1
0
        public virtual void Fetch(long productId)
        {
            if (!m_UnityConnect.isUserLoggedIn)
            {
                onFetchDetailsError?.Invoke(new UIError(UIErrorCode.AssetStoreAuthorizationError, L10n.Tr("User not logged in.")));
                return;
            }

            var purchaseInfo = m_AssetStoreCache.GetPurchaseInfo(productId.ToString());

            if (purchaseInfo != null)
            {
                FetchInternal(productId, purchaseInfo);
            }
            else
            {
                if (m_ListOperation.isInProgress)
                {
                    m_ListOperation.onOperationFinalized += op => StartFetchOperation(productId);
                }
                else
                {
                    StartFetchOperation(productId);
                }
            }
        }
 private void OnLocalInfosChanged(IEnumerable <AssetStoreLocalInfo> addedOrUpdated, IEnumerable <AssetStoreLocalInfo> removed)
 {
     // Right now we only want to check updates for downloaded assets that's also in the purchase list because users
     // don't always load all purchases and we don't want to waste time checking updates for items that are not visible.
     // In the future if we want to check update for all downloaded assets, we can remove the purchase info check here.
     InsertToCheckUpdateQueue(addedOrUpdated?.Where(info => m_AssetStoreCache.GetPurchaseInfo(info.id) != null && !info.updateInfoFetched).Select(info => info.id));
 }