destroy and create objects

Hey, I have made a script attached to a box collider that is positioned in front of the player. With the script I have so far made it possible for the player to create objects with the mouse buttons.

but I have no idea how to make that the player can also destroy objects that are infront of him/her.

EDIT:
I’ve updated the script (the last code section) with a solution that is (what I believe) to be the right direction. but something is missing, anyone of you who knows what?

here is the script:

using UnityEngine;
using System.Collections;

public class spawnscript : MonoBehaviour {


public GameObject cubeprefab;
public GameObject rectangleprefab;
public GameObject stairprefab;
public GameObject spawncube;

// Use this for initialization
void Start () {

}

// Update is called once per frame
void Update () {
	
	
			
	if(Input.GetKeyDown("mouse 0"))
	{
		
		if(idea.Instance.shadow1 == true)
		{
		
	//Vector3 position = new Vector3(camera.transform.position.x + 2, camera.transform.position.y);
	
	Instantiate(cubeprefab, transform.position, transform.rotation);
	//Physics.IgnoreCollision(cubeprefab.collider, spawncube.collider);
		}
		
	}
	
	
	if(Input.GetKeyDown("mouse 1"))
	{
	
	if(idea.Instance.shadow2 == true)
		{
		
	Instantiate(rectangleprefab, transform.position, transform.rotation);	
			
		}
		
	}
		
		
		
	if(Input.GetKeyDown("mouse 2"))
		{
		
			if(idea.Instance.shadow3 == true)
			{
				
			Instantiate(stairprefab, transform.position, transform.rotation);
				
			}
			
			
			
		}

	if(Input.GetMouseButtonUp(0))
	{
	Vector3 fwd = transform.TransformDirection(Vector3.forward);
	RaycastHit hit;
	if(Physics.Raycast(transform.position,fwd,10))
		{
			
		Destroy(hit.transform.gameObject);	
			
		}
		
	}
		
		
	}
	
	
	
	

}

If your objects already have colliders, you could use e.g. OnMouseUpAsButton() on them and destroy it from there.
Alternatively you could raycast on mouseclick and if you hit a destructible object, remove it instead of creating a new one. E.g.:

if(Input.GetMouseButtonUp(0)) 
{
    var ray = Camera.main.ScreenPointToRay (Input.mousePosition);
    var hit : RaycastHit;
    if (Physics.Raycast (ray, hit, 100)) {
        Destroy(hit.transform.gameObject);
    } else {
        // instantiate new one
    }
// ...

To restrict what can be destroyed use layer masks for your raycasts or add additional conditions like checking for tags etc.