public void UpgradePlantInPlantPoint(Plantpoint point, PlantBlueprint blueprint) { if (blueprint.upgradePlant != null) { LevelManager.Instance.TakeMoney(blueprint.upgradePrice); LevelManager.Instance.UpdateMoneyDisplay(); point.UpgradePlant(); DeselectCurrentPlantPoint(); } }
public void BuyPlantForPlantPoint(Plantpoint point, PlantBlueprint blueprint) { if (blueprint.plant != null) { LevelManager.Instance.TakeMoney(blueprint.price); LevelManager.Instance.UpdateMoneyDisplay(); point.PlantPlant(blueprint); DeselectCurrentPlantPoint(); LevelUIManager.Instance.ActivatePlantUI(point); } }
public void SellPlantInPlantPoint(Plantpoint point, PlantBlueprint blueprint) { if (!point.IsUpgraded) { LevelManager.Instance.GiveMoney(blueprint.price); } else { LevelManager.Instance.GiveMoney(blueprint.upgradePrice); } LevelManager.Instance.UpdateMoneyDisplay(); point.RemovePlant(); DeselectCurrentPlantPoint(); }
public void PlantPlant(PlantBlueprint blueprint) { if (blueprint.plant != null) { // LevelManager.Instance.TakeMoney(blueprint.price); // LevelManager.Instance.UpdateMoneyDisplay(); if (buySound != null) { SoundManager.Instance.PlaySfx(soundSource, buySound); } currentPlant = Instantiate(blueprint.plant, transform.position, transform.rotation); currentBlueprint = blueprint; //PlantStore.Instance.DeselectCurrentActiveEmptyPlantpoint(); VisualEffects.CreateVisualEffect(buyVfx, transform); } return; }
public void ClearPlantPoint() { currentBlueprint = null; currentPlant = null; }
public void RequestBuild(PlantBlueprint blueprintToBuild) { BuildPlantEvent?.Invoke(currentPlantPoint, blueprintToBuild); }