I want to make a top down space shooter.
The bullets are particle.
On my Enemy Class i have made this:
void OnParticleCollision(GameObject other) {
life--;
if (life <= 0) {
Destroy(gameObject);
}
}
This working perfect.
But one of my mechanic in this game is, to shoot bullets with different color.
So the player can switch his bullet color.
Some Enemys are resisdent against a specific color.
So I must check in the OnParticleCollision() which color the colliding Particle have.
void OnParticleCollision(GameObject other) {
life--;
//Check here which Color this Particle have
//<--- insert code
if (life <= 0) {
Destroy(gameObject);
}
}
Does somebody has any idea?