void Start() { gunShopStats = GunShopStats.available; currentPrice = lvlMaxCost; maxCost = CalculateMaxCost(); changingPrice = false; processing = false; weaponGenerator.weaponLVLMin = 0; weaponGenerator.weaponLVLMax = 0; InitializeUI(); }
IEnumerator Processing() { processing = true; GameManager.instance.players[0].playerCoins -= currentPrice; UIManager.instance.UpdateCoins(); yield return(new WaitForSeconds(processingTime)); weaponGenerator.GenerateWeapon(); gunShopStats = GunShopStats.available; buyGenericInteractable.interactable = true; priceUpGenericInteractable.interactable = true; priceDownGenericInteractable.interactable = true; processing = false; }
void Shopping() { if (priceUpButton.onOff == true && changingPrice == false) { StartCoroutine(PriceChange(CalculateAmount())); } if (priceDownButton.onOff == true && changingPrice == false) { StartCoroutine(PriceChange(-CalculateAmount())); } if (buyButton.onOff == true) { buyButton.onOff = false; if (GameManager.instance.players[0].playerCoins >= currentPrice && currentPrice >= lvlMaxCost) { gunShopStats = GunShopStats.processing; buyGenericInteractable.interactable = false; priceUpGenericInteractable.interactable = false; priceDownGenericInteractable.interactable = false; } } }