示例#1
0
    // Use this for initialization
    void Start()
    {
        StorePriceScriptableObject storePrice = StoreObjectPurchaseController.Instance.StorePrice;

        StorePriceScriptableObject.StorePriceMap storePriceMap = storePrice.GetStorePriceMap(storeObject);
        Title.text       = storeObject.ToString();
        Description.text = storePriceMap.Description;
        Gem.SetActive(storePriceMap.PurchaseUsingGem);
        string PriceText = storePriceMap.PurchaseUsingGem ? storePriceMap.Price.ToString() : "$ " + storePriceMap.Price.ToString();

        Price.text         = PriceText;
        ActiveObjects.text = "Active Items : " + StoreObjectPurchaseController.Instance.GetNoOfStoreObjectPurchased(storeObject);
        Image.sprite       = storePriceMap.Image;
    }
示例#2
0
 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());
     }
 }