public override void Execute() { if (StoreKitHelper.GetRequestState() == RequestProductState.RequestSuccess) { List <ShopItemInformation> products = this.ConstructShopItemInformation(); if (products == null) { this.OnRequestFail(); } else { if (this.SuccessorContext != null) { this.ShopModule.ChangeContext(this.SuccessorContext); } else { this.ShopModule.State = ShopActionState.Idle; IdleContext idleContext = new IdleContext(); this.ShopModule.ChangeContext(idleContext); } this.ShopModule.OnRequestSuccessed(products); } } else if (StoreKitHelper.GetRequestState() == RequestProductState.RequestFail) { this.OnRequestFail(); } }
private void OnRequestFail() { this.ShopModule.State = ShopActionState.Fail; IdleContext idleContext = new IdleContext(); this.ShopModule.ChangeContext(idleContext); this.ShopModule.OnRequestFailed(string.Empty); }
public override void Execute() { PurchaseState purchaseState = StoreKitHelper.GetPurchaseState(); Debug.Log("the state is : " + purchaseState.ToString()); /* * if(purchaseState == PurchaseState.PurchasePurchasing) * { * NetWorkDialog.Instance.HideConnectingWithoutManager(); * } */ if (purchaseState == PurchaseState.PurchaseSuccess) { ConfirmingContext confirmingContext = new ConfirmingContext() { ProductID = this.ProductID }; this.ShopModule.ChangeContext(confirmingContext); } else if (purchaseState == PurchaseState.PurchaseFail || purchaseState == PurchaseState.PurchaseCancel) { IdleContext idleContext = new IdleContext(); this.ShopModule.ChangeContext(idleContext); if (purchaseState == PurchaseState.PurchaseFail) { this.ShopModule.State = ShopActionState.Fail; //this.ShopModule.OnPurchaseFailed(PurchaseFailedReason.Abort); } else { this.ShopModule.State = ShopActionState.Cancel; //this.ShopModule.OnPurchaseFailed(PurchaseFailedReason.Cancel); } } }