void OnCollisionEnter(Collision col) { if (col.gameObject.name == "Wall") { Destroy (gameObject); } else if (col.gameObject.name == "BlueVirus"){ bVirus = col.gameObject.GetComponent<BlueVirus>(); bVirus.takeDamage (1,1); Destroy (gameObject); } else if (col.gameObject.name == "RedVirus"){ Destroy (gameObject); } else if (col.gameObject.name == "GreenVirus"){ gVirus = col.gameObject.GetComponent<GreenVirus>(); gVirus.takeDamage (1,1); Destroy (gameObject); }else if(col.gameObject.name == "Boss"){ boss = col.gameObject.GetComponent<BossScript>(); boss.takeDamage(1, 1); Destroy(gameObject); } }
void OnCollisionEnter(Collision col) { if(col.gameObject.name == "BlueVirus") { bVirus = col.gameObject.GetComponent<BlueVirus>(); if(bVirus.alive == true) stunned = true; }else if(col.gameObject.name == "GreenVirus") { gVirus = col.gameObject.GetComponent<GreenVirus>(); if(gVirus.alive == true) stunned = true; }else if(col.gameObject.name == "RedVirus") { rVirus = col.gameObject.GetComponent<RedVirus>(); if(rVirus.alive == true) stunned = true; }else if(col.gameObject.name == "Boss") { boss = col.gameObject.GetComponent<BossScript>(); if(boss.alive == true) stunned = true; } }