Low FPS because of changing sprites

I am making a top down 2D zombie shooter game. Much like the SAS games, there are barricades in the game. The barricades consists of 6 sprites. The sprite that is shown depends on the amount of hitpoints that the barricade has. If the barricade has 90% hit points left, the sprite is changed, if it has 75% left the sprite is changed and so on until the barricade is broken.

The problem is that I get around 21 FPS when there are 4 barricades being damaged by zombies. As soon as the barricades have either broken or the zombies are killed the FPS goes back to about 200. Why so? Is this a bad method for sprite rendering? This is one of my first games, keep that in mind! This is the code:

if (gameObject.GetComponent<HealthController> ().currentHealth >= maxHp) {
			gameObject.GetComponent<SpriteRenderer>().sprite = undamaged;
		}
		if (gameObject.GetComponent<HealthController> ().currentHealth < maxHp * 0.99f && gameObject.GetComponent<HealthController> ().currentHealth > maxHp * 0.75f) {
			gameObject.GetComponent<SpriteRenderer>().sprite = damaged1;
		}
		if (gameObject.GetComponent<HealthController> ().currentHealth < maxHp * 0.75f && gameObject.GetComponent<HealthController> ().currentHealth > maxHp * 0.6f) {
			gameObject.GetComponent<SpriteRenderer>().sprite = damaged2;
		}
		if (gameObject.GetComponent<HealthController> ().currentHealth < maxHp * 0.6f && gameObject.GetComponent<HealthController> ().currentHealth > maxHp * 0.45f) {
			gameObject.GetComponent<SpriteRenderer>().sprite = damaged3;
		}
		if (gameObject.GetComponent<HealthController> ().currentHealth < maxHp * 0.45f && gameObject.GetComponent<HealthController> ().currentHealth > maxHp * 0.3f) {
			gameObject.GetComponent<SpriteRenderer>().sprite = damaged4;
		}
		if (gameObject.GetComponent<HealthController> ().currentHealth < maxHp * 0.3f && gameObject.GetComponent<HealthController> ().currentHealth > maxHp * 0.15f) {
			gameObject.GetComponent<SpriteRenderer>().sprite = damaged5;
		}

Appreciate some answers!

You appear to be calling gameObject.GetComponent<HealthController>() 11 times every frame. Not only does this make your code very hard to read, it’s going to be slow.
Access it once and save it in a variable. And, seeing as your if conditions are mutually-exclusive, use else if to prevent unnecessary tests.

Something more like this:

private HealthController hC;
private SpriteRenderer sR;

public void Start() {
  // Cache the components *once* in Start()
  hC = gameObject.GetComponent<HealthController>();
  sR = GetComponent<SpriteRenderer>();
}

void Update() {

  if(hC.currentHealth >= maxHp) {
         sR.sprite = undamaged;
     }
  else if (hC.currentHealth > maxHp * 0.75f) {
         sR.sprite = damaged1;
     }
  else if (hC.currentHealth > maxHp * 0.6f) {
         sR.sprite = damaged2;
     }
  else if (hC.currentHealth > maxHp * 0.45f) {
        sR.sprite = damaged3;
  }
... etc. etc....

Solved it guys! I was looking in the profiler and noticed that GUI.Repaint was at 97%! In my healthcontroller, I render healthbars. The healthbars were rendered for barricades too. I fixed this by adding:

if (gameObject.tag == “Player” || gameObject.tag == “Zombie”){
renderHealthbars
}

Now I get 300 FPS:) Thanks a bunch!