Exemple #1
0
    public IEnumerator InitStore()
    {
        if (this.init_status > StoreInit.STATUS.DONE_NOTHING)
        {
            yield break;
        }
        bool result      = false;
        bool initialized = false;

        StoreUtil.Instance().InitStore(delegate(bool r)
        {
            result      = r;
            initialized = true;
        });
        while (!initialized)
        {
            yield return(null);
        }
        if (!result)
        {
            bool isShow    = Loading.IsShow();
            bool isBarrier = GUIMain.IsBarrierON();
            if (isShow)
            {
                Loading.Invisible();
            }
            if (isBarrier)
            {
                GUIMain.BarrierOFF();
            }
            bool isClosed = false;
            AlertManager.ShowAlertDialog(delegate(int i)
            {
                isClosed = true;
            }, "C-NP200");
            while (!isClosed)
            {
                yield return(null);
            }
            if (isShow)
            {
                Loading.ResumeDisplay();
            }
            if (isBarrier)
            {
                GUIMain.BarrierON(null);
            }
        }
        else
        {
            this.init_status = StoreInit.STATUS.DONE_INIT;
        }
        global::Debug.Log("================================================= STORE INIT isSuccess --> " + result);
        yield break;
    }
Exemple #2
0
    private IEnumerator ReConsume()
    {
        if (this.init_status != StoreInit.STATUS.DONE_REQUEST_PRODUCT)
        {
            yield break;
        }
        bool isSuccess  = false;
        bool isFinished = false;

        StoreUtil.Instance().ReConsumeNonConsumedItems(delegate(bool result)
        {
            isFinished = true;
            isSuccess  = result;
        });
        while (!isFinished)
        {
            yield return(null);
        }
        global::Debug.Log("================================================= STORE ReConsume isSuccess --> " + isSuccess);
        if (!isSuccess)
        {
            bool isShow    = Loading.IsShow();
            bool isBarrier = GUIMain.IsBarrierON();
            if (isShow)
            {
                Loading.Invisible();
            }
            if (isBarrier)
            {
                GUIMain.BarrierOFF();
            }
            bool isClosed = false;
            AlertManager.ShowAlertDialog(delegate(int i)
            {
                isClosed = true;
            }, "C-SH02");
            while (!isClosed)
            {
                yield return(null);
            }
            if (isShow)
            {
                Loading.ResumeDisplay();
            }
            if (isBarrier)
            {
                GUIMain.BarrierON(null);
            }
        }
        else
        {
            this.init_status = StoreInit.STATUS.DONE_RECONSUME;
        }
        yield break;
    }
Exemple #3
0
    private IEnumerator GetProducts(string[] productIDS, bool stateChange)
    {
        string err        = "err";
        bool   isFinished = false;

        StoreUtil.Instance().RequestProducts(productIDS, delegate(string result)
        {
            err        = result;
            isFinished = true;
        });
        while (!isFinished)
        {
            yield return(null);
        }
        if (err != string.Empty)
        {
            bool isShow    = Loading.IsShow();
            bool isBarrier = GUIMain.IsBarrierON();
            if (isShow)
            {
                Loading.Invisible();
            }
            if (isBarrier)
            {
                GUIMain.BarrierOFF();
            }
            bool isClosed = false;
            AlertManager.ShowAlertDialog(delegate(int i)
            {
                isClosed = true;
            }, AlertManager.GetNeptuneErrorCode(err));
            while (!isClosed)
            {
                yield return(null);
            }
            if (isShow)
            {
                Loading.ResumeDisplay();
            }
            if (isBarrier)
            {
                GUIMain.BarrierON(null);
            }
            this.getProductsSucceed = false;
        }
        else
        {
            if (stateChange)
            {
                this.init_status = StoreInit.STATUS.DONE_REQUEST_PRODUCT;
            }
            this.getProductsSucceed = true;
        }
        yield break;
    }
Exemple #4
0
    private void SetProductScrollView()
    {
        this.productScrollView.Callback = new Action(this.SetDigistoneNumber);
        Vector3     localPosition = this.productScrollView.transform.localPosition;
        GUICollider component     = this.productScrollView.GetComponent <GUICollider>();

        component.SetOriginalPos(localPosition);
        this.productScrollView.selectParts = this.productScrollViewItem;
        Rect listWindowViewRect = default(Rect);

        listWindowViewRect.xMin = -560f;
        listWindowViewRect.xMax = 560f;
        listWindowViewRect.yMin = -256f - GUIMain.VerticalSpaceSize;
        listWindowViewRect.yMax = 256f + GUIMain.VerticalSpaceSize;
        this.productScrollView.ListWindowViewRect = listWindowViewRect;
        this.storeProductList = StoreUtil.Instance().GetStoneStoreDataList();
        this.productScrollView.initLocation = true;
        this.productScrollView.AllBuild(this.storeProductList);
    }
    private IEnumerator StartPurchaseItem(string productId, Action <bool> onCompleted)
    {
        bool          isFinished = false;
        Action <bool> onFnished  = null;

        if (null != CMD_Shop.instance)
        {
            onFnished = delegate(bool isSuccess)
            {
                if (onCompleted != null)
                {
                    if (isSuccess && 0 < this.data.limitCount)
                    {
                        this.data.purchasedCount++;
                        if (this.data.purchasedCount >= this.data.limitCount && null != CMD_Shop.instance)
                        {
                            CMD_Shop.instance.DeleteListParts(this.IDX);
                        }
                    }
                    onCompleted(isSuccess);
                }
                isFinished = true;
            };
        }
        else
        {
            onFnished = delegate(bool nop)
            {
                isFinished = true;
            };
        }
        StoreUtil.Instance().StartPurchaseItem(productId, onFnished);
        while (!isFinished)
        {
            yield return(null);
        }
        yield break;
    }