Multipler Collision Stages.

Haven't asked a question in awhile so thought I might. I have scripted a wall (2D and they are sprites) which when a bullet collides with it it deterorates (sp) into a different stage. this happens 6 times and on the 6th collision it is destorys into a few bricks. My problem is that when it collides it moves through all of the stages into being destroyed without going stage by stage.

How do I make it go stage by stage of destruction.

using UnityEngine;
using System.Collections;

public class ConcDestructionScript : MonoBehaviour {

private bool stage1 = true;
private bool stage2 = false;
private bool stage3 = false;
private bool stage4 = false;
private bool stage5 = false;
private bool stage6= false;
public GameObject conc1;
public GameObject conc2;
public GameObject conc3;
public GameObject conc4;
public GameObject conc5;
public GameObject conc6;
public GameObject Brick1;
public GameObject Brick2;
public GameObject Brick3;

void OnCollisionEnter( Collision collision )
{
    if ( stage1 == true)
    {
        conc1.active = false;
        conc2.active = true;
        stage1 = false;
        stage2 = true;
    }
    if ( stage2 == true )
    {
        conc2.active = false;
        conc3.active = true;
        stage2 = false;
        stage3 = true;
    }
    if ( stage3 == true )
    {
        conc3.active = false;
        conc4.active = true;
        stage3 = false;
        stage4 = true;
    }
    if ( stage4 == true )
    {
        conc4.active = false;
        conc5.active = true;
        stage4 = false;
        stage5 = true;
    }
    if ( stage5 == true )
    {
        conc5.active = false;
        conc6.active = true;
        stage5 = false;
        stage6 = true;
    }
    if ( stage6 == true )
    {
    conc6.active = false;
    // Yet to add brick instantiation.
    Destroy (gameObject);
    }
}
}

I understand why it goes through all of them to destruction into bricks, Question is how do I make it do it stage by stage. (I have also yet to put in that only the collision happens with bullets tagged bullets (So no need to say I missed that or anything)

Cheers, Aaron Lewis

Well, I believe the problem would be because it literally runs through all the stages in one go...

Basically...

If you look carefully, after the Stage1== true check, stage2 becomes true, which would make the following Stage2== true check true, and etc etc...

Since code goes down the lines, all your ==true statements will activate one after the other.

A better way would be to replace the if statements with else-ifs, like

if ( stage1 == true)
{
    conc1.active = false;
    conc2.active = true;
    stage1 = false;
    stage2 = true;
}
else if ( stage2 == true )
{
    conc2.active = false;
    conc3.active = true;
    stage2 = false;
    stage3 = true;
}
else if ( stage3 == true )
{
    conc3.active = false;
    conc4.active = true;
    stage3 = false;
    stage4 = true;
}
else if ( stage4 == true )
{
    conc4.active = false;
    conc5.active = true;
    stage4 = false;
    stage5 = true;
}
else if ( stage5 == true )
{
    conc5.active = false;
    conc6.active = true;
    stage5 = false;
    stage6 = true;
}
else if ( stage6 == true )
{
conc6.active = false;
// Yet to add brick instantiation.
Destroy (gameObject);
}

So that only one of these if statements will activate at each collision.

Does that help?