Why does this crash Unity? Ammo goes from 12 down to 0 when the loop stops so there is no need to crash.

using UnityEngine;
using System.Collections;

public class TestScript : MonoBehaviour {

public bool MouseClick = true;
public int Ammo = 12;

void Start(){
	while (MouseClick = true) {
		Ammo = Ammo - 1;
		if(Ammo <= 0){
			MouseClick = false;
		}else{
			print ("Bang");
		}
	}
	print("Empty");
	}

}

Change the = to == here:
while (MouseClick = true)

From what i know = means you are setting something to something and == compares something to something. I tested this and with == it does not crash.