コード例 #1
0
        public void UpdateCatalog(Action <List <ServerlessCatalogItem> > onSuccess = null, Action <Error> onError = null)
        {
            List <ServerlessCatalogItem> catalog = GetCatalog();

            _items      = catalog.Where(i => i.IsVirtualItem()).ToList();
            _currencies = catalog.Where(i => i.IsCurrency()).ToList();

            UpdateItemsEvent?.Invoke(_items);
            UpdateVirtualCurrenciesEvent?.Invoke(_currencies);
            onSuccess?.Invoke(catalog);
        }
コード例 #2
0
        private IEnumerator UpdateVirtualCurrenciesCoroutine(Action <Error> onError = null)
        {
            var busy = true;

            SdkCatalogLogic.Instance.GetVirtualCurrencies(items =>
            {
                VirtualCurrencies = items;
                UpdateVirtualCurrenciesEvent?.Invoke(items);
                busy = false;
            }, onError);
            yield return(new WaitWhile(() => busy));
        }
コード例 #3
0
    private IEnumerator UpdateVirtualCurrenciesCoroutine(Action <Error> onError = null)
    {
        var busy = true;

        _demoImplementation.GetCatalogVirtualCurrencies(items =>
        {
            Currencies = items;
            AllItems.AddRange(items);
            UpdateVirtualCurrenciesEvent?.Invoke(items);
            busy = false;
        }, onError);
        yield return(new WaitWhile(() => busy));
    }