public void SellWeapon() { if (!saleInitiated) { saleInitiated = true; this.buttons["W"].GetComponent <Image>().sprite = sellConfirmSprite; } else { if (connectedZone) { int worth = (turret.costCurrency) / 2; //sell for half of purchase cost GameManager.Instance.PlayerCurrencyTransaction(worth); currentWeaponUpgradeSprite.sprite = null; connectedZone.Clear(); connectedZone.CloseOut(); } } }
public void RecalculateZones() { BuildZone.Clear(); CantBuildZone.Clear(); foreach (var tile in _tiles) { var obj = tile.GridObject; if (obj == null) { continue; } var build = GridUtility.SquaredZone(tile, obj.ExpandBuildZoneSize); var cantBuild = GridUtility.SquaredZone(tile, obj.CantBuildZoneSize); BuildZone.UnionWith(build); CantBuildZone.UnionWith(cantBuild); } BuildZone.ExceptWith(CantBuildZone); }