} //buysystem public void SelectHouse(HouseSpawn houseSpawn) { if (selectedHouseSpawn == houseSpawn) { DeselectNode(); return; } selectedHouseSpawn = houseSpawn; houseToBuild = null; upSellUI.SetTarget(houseSpawn); }
public TextMeshProUGUI sellAmount; //verkaufen public void SetTarget(HouseSpawn _target) { target = _target; transform.position = target.GetBuildPosition() + positionOffset; //Die normale position ist im Object durch target.GetBUildPostition wird die if (!target.isUpgraded) { upgradeCost.text = "$" + target.houseBlueprint.upgradeCost; //Updatet den text für cost in upgrade- upgradeButton.interactable = true; } else { upgradeCost.text = "Done"; upgradeButton.interactable = false; } sellAmount.text = "$" + target.houseBlueprint.GetSellAmount(); //verkaufen textupdate. ui.SetActive(true); } //position auf das object drauf gespawn.
public void DeselectNode() { selectedHouseSpawn = null; upSellUI.Hide(); }