public void UpgradeButtonClicked() { if (goldManager.IsEnoughGold(upgradePrice)) { Debug.Log("Upgrade " + name); pb.BarValue += 1; goldManager.DecreaseGold(upgradePrice); } }
public static void IncreaseFoodAmount() { int amount = 200; if (GoldManager.GoldAmount >= amount) { FoodManager.Instance.MaxFoodAmount++; GoldManager.DecreaseGold(amount); } }
public static void UpgradeFood() { int amount = 300; if (GoldManager.GoldAmount >= amount) { FoodManager.Instance.CurrentFoodIndex++; GoldManager.DecreaseGold(amount); } }
public void SpawnFood() { if (FoodsOnScreen < maxFoodAmount) { Vector3 position = cam.ScreenToWorldPoint(Input.mousePosition); position.z = 0; objectPooler.SpawnFromPool(currentFood.name, position); GoldManager.DecreaseGold(5); } }
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); } }