示例#1
0
 public void UpgradePlantInPlantPoint(Plantpoint point, PlantBlueprint blueprint)
 {
     if (blueprint.upgradePlant != null)
     {
         LevelManager.Instance.TakeMoney(blueprint.upgradePrice);
         LevelManager.Instance.UpdateMoneyDisplay();
         point.UpgradePlant();
         DeselectCurrentPlantPoint();
     }
 }
示例#2
0
 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);
     }
 }
示例#3
0
 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();
 }
示例#4
0
    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;
    }
示例#5
0
 public void ClearPlantPoint()
 {
     currentBlueprint = null;
     currentPlant     = null;
 }
示例#6
0
 public void RequestBuild(PlantBlueprint blueprintToBuild)
 {
     BuildPlantEvent?.Invoke(currentPlantPoint, blueprintToBuild);
 }