Unity UI counter resets when accessed by separate (same) scripts (JS)

I have a simple counter in my office scene that adds up the cost of damage the player causes each time they break anything made of glass, e.g. doors, windows etc. Each pane of glass has the following script on it which is called when the glass breaks:

var countText : Text;
private var count : int;

function SetCounter() {
count = count + 350;
countText.text = "Damage Bill: $" + count.ToString();

}

This works fine, and it tallies up the damage nicely, but the player also has the option to drop mines to eradicate the enemy, and I have the same script called by the mines when they explode, accessing the same Text, but if there is already a tally in the UI, when the mine destroys any glass, it resets the count from zero - vice versa if a mine does any damage first and starts the count, and then the player breaks a window - again the count restarts from zero, listing just the damage amount of the window. The windows tally up one after another no problem as they’re broken, but when I call the same script from the mine explosion, the reset occurs.

The only difference is in the way the scripts are called; the windows do it directly as they are already in the scene, and the mines, being instantiated prefabs, call the script from an existing empty gameobject which has the same script on it.
Any idea what I am doing wrong here? Thanks for any/all replies.

Since each pane of glass has this script running then for each pane of glass the count will start from zero.
You need to share the count variable so it will be global to all objects affecting it.

One way will be to have a game manager script (attached to an empty game object) which will be implemented as singleton and this game manager will store the count.
This way the glass pane and mines could update the count via the game manager and maintain the correct bill value.

Look at this Unity tutorial for an idea of a game manager

Thanks, you were correct in your suggestion, and seeing as how I already had the counter script attached to an empty in the scene, I changed the script on the glass to call this same script, instead of individually - this had pretty much the same effect as your suggestion, and all is well now, everybody tallies up nicely with everybody else. Thanks again.
Cheers.