コード例 #1
0
 void Start()
 {
     gunShopStats  = GunShopStats.available;
     currentPrice  = lvlMaxCost;
     maxCost       = CalculateMaxCost();
     changingPrice = false;
     processing    = false;
     weaponGenerator.weaponLVLMin = 0;
     weaponGenerator.weaponLVLMax = 0;
     InitializeUI();
 }
コード例 #2
0
    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;
    }
コード例 #3
0
 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;
         }
     }
 }