public void SelectTrapToBuild(TrapBlueprint _trap) { build_trap = _trap; selected_node = null; build_turret = null; DeselectNode(); }
public void SelectTurretToBuild(TurretBlueprint _turret) { build_turret = _turret; selected_node = null; build_trap = null; DeselectNode(); }
public void SelectNode(spots _spot) { if (selected_node == _spot) { DeselectNode(); return; } selected_node = _spot; build_turret = null; build_trap = null; turretUI.SetTarget(_spot); shop.archer_selected = false; shop.slauncher_selected = false; shop.flame_selected = false; shop.mortar_selected = false; }
void BuildTrap(TrapBlueprint _blueprint) { //check if the player has enough money to build. otherwise nothing happens and an error message happens. if (PlayerStats.money < _blueprint.cost) { Debug.Log("Not enough money to build."); return; } //otherwise, remove their money from the cost and build them the tower. PlayerStats.money -= _blueprint.cost; GameObject _trap = (GameObject)Instantiate(_blueprint.prefab, GetBuildPosition(), Quaternion.identity); _trap.transform.parent = GameObject.Find("BuildList").transform; trap = _trap; Destroy(_trap, trap_destroy_time); trap_blueprint = _blueprint; }
public void ResetSelection() { build_turret = null; build_trap = null; }