Esempio n. 1
0
 public void UpgradeButtonClicked()
 {
     if (goldManager.IsEnoughGold(upgradePrice))
     {
         Debug.Log("Upgrade " + name);
         pb.BarValue += 1;
         goldManager.DecreaseGold(upgradePrice);
     }
 }
Esempio n. 2
0
    public static void IncreaseFoodAmount()
    {
        int amount = 200;

        if (GoldManager.GoldAmount >= amount)
        {
            FoodManager.Instance.MaxFoodAmount++;
            GoldManager.DecreaseGold(amount);
        }
    }
Esempio n. 3
0
    public static void UpgradeFood()
    {
        int amount = 300;

        if (GoldManager.GoldAmount >= amount)
        {
            FoodManager.Instance.CurrentFoodIndex++;
            GoldManager.DecreaseGold(amount);
        }
    }
Esempio n. 4
0
 public void SpawnFood()
 {
     if (FoodsOnScreen < maxFoodAmount)
     {
         Vector3 position = cam.ScreenToWorldPoint(Input.mousePosition);
         position.z = 0;
         objectPooler.SpawnFromPool(currentFood.name, position);
         GoldManager.DecreaseGold(5);
     }
 }
Esempio n. 5
0
    public static void SpawnFish(string tag, string goldAmount)
    {
        int amount = int.Parse(goldAmount);

        if (GoldManager.GoldAmount >= amount)
        {
            Vector3    position    = new Vector3(Utility.GenerateRandomVector3().x, Utility.MaxFishHeight, 0);
            GameObject fishSpawned = ObjectPooler.Instance.SpawnFromPool(tag, position);
            fishSpawned.GetComponent <Rigidbody2D>().AddForce(downForce, ForceMode2D.Impulse);

            GoldManager.DecreaseGold(amount);
        }
    }