示例#1
0
        private IEnumerator C_DialogCoroutine()
        {
            while (true)
            {
                if (_currentDialogRequest == null && _dialogResponsesQueue.Count > 0)
                {
                    _currentDialogRequest = _dialogResponsesQueue.Dequeue();

                    var pushId = _currentDialogRequest.id;

                    var buttons = new List <DialogButtons>();
                    if (_currentDialogRequest.onOk != null)
                    {
                        buttons.Add(DialogButtons.Ok);
                    }
                    if (_currentDialogRequest.onCancel != null)
                    {
                        buttons.Add(DialogButtons.Cancel);
                    }
                    CancelNotification(_currentDialogRequest.id);

                    if (buttons.Count == 0)
                    {
                        LogUtils.LogError("Cant show dialog without buttons");
                    }
                    else
                    {
                        ShowDeviceDialog(_currentDialogRequest.title, _currentDialogRequest.message, buttons.ToArray());

                        while (_currentDialogRequest != null)
                        {
                            yield return(0);
                        }
                    }

                    _dialogPushIds.Remove(pushId);
                }

                yield return(0);
            }
        }
示例#2
0
        public GowDataStorage()
        {
            var line = PlayerPrefs.GetString(GOW_DATA, null);

            if (string.IsNullOrEmpty(line))
            {
                _gowData = new JsonObject();
            }
            else
            {
                try
                {
                    _gowData = (JsonObject)GoWMiniJSON.Deserialize(line);
                }
                catch (Exception e)
                {
                    LogUtils.LogError(e.Message);
                    LogUtils.LogError(e.StackTrace);
                    _gowData = new JsonObject();
                }
            }
        }
示例#3
0
 private void InitSpecialOffers(IEnumerable <JsonObject> specialOffersJson)
 {
     _specialOffers.Clear();
     specialOffersJson.ForEach(sobj =>
     {
         try
         {
             var def = new SpecialOffers.Definition(sobj);
             _specialOffers.Add(def);
             def.GetIds()
             .ForEach(id =>
             {
                 _configurationBuilder.products.Add(CreateProduct(id, ProductType.Consumable));
             });
         }
         catch (Exception x)
         {
             LogUtils.LogError(x.Message);
             LogUtils.LogError(x.StackTrace);
         }
     });
 }