private void cancelBuild(){
        if (placeHolder != null){           //cancels the building of a tower
            removeObject(placeHolder);

            placeHolder = null; 
            place = false; 

            removeObject (r);
            r = null;
        }
        else if (selectedTower != null){         //cancels the selection of a tower
            ui.changeUi (0);
            showRange (0, false);
            selectedTower = null;
        }

        if (ui.getId () != 0){
            ui.changeUi (0);
        }
        resetDefaultUi();
    }