示例#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 ActivatePlantPointUI(Plantpoint target)
 {
     if (target.IsEmpty())
     {
         ActivateBuildUI(target);
     }
     else
     {
         ActivatePlantUI(target);
     }
 }
示例#4
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();
 }
示例#5
0
 public void SetCurrentPlantPoint(Plantpoint point)
 {
     currentPlantPoint = point;
 }
示例#6
0
 private void ActivateBuildUI(Plantpoint plantPoint)
 {
     LevelUIManager.Instance.ActivateBuildUI(plantPoint);
 }
示例#7
0
 private void OnPlantPointCLicked(Plantpoint target)
 {
     DeselectCurrentPlantPoint();
     ActivatePlantPointUI(target);
 }
示例#8
0
 /// <summary>
 /// Activates the build UI in a target plantpoint.
 /// </summary>
 /// <param name="plantPoint"> Plantpoint where the UI should be display.</param>
 public void ActivateBuildUI(Plantpoint plantPoint)
 {
     buildCanvasUI.transform.position = plantPoint.transform.position + new Vector3(0, 0, zOffsetForCanvasLocation);
     ActivateBuildUI(true);
 }