public void deathOrb(OrbScript orb) { if (orb.GetOrbColor() != OrbScript.OrbColor.Red) { greenOrbs.Remove(orb); } else { redOrbs.Remove(orb); } Destroy(orb.gameObject); }
public void touchOrb(OrbScript orb) { if (!paused) { if (orb.GetOrbColor() == OrbScript.OrbColor.Red) { GetComponent <AudioSource>().clip = balloon; GetComponent <AudioSource>().Play(); KillAllOrbs(); gameover.EndGame(); music.Stop(); } else { if (orb.GetOrbColor() == OrbScript.OrbColor.Gold) { GetComponent <AudioSource>().clip = goldPop; GetComponent <AudioSource>().Play(); } else { int randomSound = Random.Range(0, 2); GetComponent <AudioSource>().clip = pop[randomSound]; GetComponent <AudioSource>().Play(); } if (orb.GetOrbColor() == OrbScript.OrbColor.Gold) { score += 5; } else { score++; } scoreText.text = "" + score; } deathOrb(orb); } }