public StorePriceMap GetStorePriceMap(StoreObjectPurchaseController.StoreObject storeObject) { var storePriceMap = from p in StorePrices where p.storeObject == storeObject select p; return(storePriceMap.FirstOrDefault()); }
public void ShowPurchaseConfirmPopUp(int storeObjectIndex) { StoreObjectPurchaseController.StoreObject storeObject = (StoreObjectPurchaseController.StoreObject)storeObjectIndex; if (StoreObjectPurchaseController.Instance.IsSuffientFundsAvailable(storeObject)) { StorePriceScriptableObject storePrice = StoreObjectPurchaseController.Instance.StorePrice; StorePriceScriptableObject.StorePriceMap storePriceMap = storePrice.GetStorePriceMap(storeObject); PriceText.text = storePriceMap.Price.ToString(); PurchaseItemImage.sprite = storePriceMap.NoBgImage; ConfirmationPopUp.SetActive(true); PopUpsBg.enabled = true; storeObjectSelected = storeObject; } else { InsufficientFundsPopUp.SetActive(true); PopUpsBg.enabled = true; StartCoroutine(InsufficientFundTimeoutCoroutine()); } }
public void ClaimBonus() { if (index < 5) { StoreObjectPurchaseController.StoreObject storeObject = (StoreObjectPurchaseController.StoreObject)(index + 1); StoreObjectPurchaseController.Instance.AddStoreObject(storeObject); } else if (index == 5) { GameTicketManager.Instance.IncrementTickets(); } else if (index == 6) { GemScript.Instance.TotalGems += 50; GemText.text = GemScript.Instance.TotalGems.ToString(); } DailyBonusPresentation.SetActive(false); PlayerPrefs.SetString("LastBonusAwardedDateTime", DateTime.Today.ToString()); PlayerPrefs.Save(); }
public void CancelPurchase() { storeObjectSelected = StoreObjectPurchaseController.StoreObject.None; ConfirmationPopUp.SetActive(false); PopUpsBg.enabled = false; }
public void OnPurchaseComplete(StoreObjectPurchaseController.StoreObject storeObject) { GemText.text = GemScript.Instance.TotalGems.ToString(); }