// Start is called before the first frame update private void OnTriggerEnter(Collider other) { if (other.gameObject.tag.Equals("bolt")) { AstroParticles.Astro(gameObject.transform); GameHazard.reEnque(gameObject); PlayerController.reEnque(other.gameObject); SoundManager.PlaySound("Explosion"); ScoreSystem.UpdateScore(); Points.getPoints(); } else if (other.gameObject.tag.Equals("ship")) { MenuManager.DeadMenu(); AstroParticles.Astro(gameObject.transform); PlaneParticles.Particles(); GameHazard.reEnque(gameObject); SoundManager.PlaySound("Explosion"); Debug.Log(other.gameObject.tag); other.gameObject.SetActive(false); SoundManager.PlaySound("Explosion"); GameHazard.playeralive = false; } else if (other.gameObject.tag.Equals("missile")) { AstroParticles.Astro(gameObject.transform); GameHazard.reEnque(gameObject); SoundManager.PlaySound("Explosion"); ScoreSystem.UpdateScore(); Points.getPoints(); Destroy(other.gameObject.transform.parent.gameObject); } }
/*--------------------------------------------------------------------------------- * ---------------------------------------------------------------------------------- * * In this Script Boss Missiles Are Destroyed When hit's the Boundry and Plane. * * ---------------------------------------------------------------------------------- * ---------------------------------------------------------------------------------*/ private void OnTriggerEnter(Collider other) { if (other.gameObject.tag.Equals("ship")) { MenuManager.DeadMenu(); PlaneParticles.Particles(); other.gameObject.SetActive(false); Destroy(gameObject); SoundManager.PlaySound("Explosion"); } }
//Destroyes The Ship when hit by blue Bolt shot by the boss. private void OnTriggerEnter(Collider other) { if (other.gameObject.tag.Equals("bluebolt")) { MenuManager.DeadMenu(); gameObject.SetActive(false); PlaneParticles.Particles(); GameHazard.playeralive = false; SoundManager.PlaySound("Explosion"); other.gameObject.SetActive(false); } }
/*--------------------------------------------------------------------------------- * ---------------------------------------------------------------------------------- * * In this Script Boss Takes Damage When gets hit by Player's bolt or missiles. * If the Player somehow hits the boss, the player dies. * * ---------------------------------------------------------------------------------- * ---------------------------------------------------------------------------------*/ // Start is called before the first frame update private void OnTriggerEnter(Collider other) { if (other.gameObject.tag.Equals("bolt")) { Boss boss = FindObjectOfType <Boss>(); boss.Damage(); //Bolt Queuing PlayerController.reEnque(other.gameObject); SoundManager.PlaySound("Explosion"); } else if (other.gameObject.tag.Equals("misssile")) { Boss boss = FindObjectOfType <Boss>(); boss.Damage(); boss.Damage(); boss.Damage(); boss.Damage(); boss.Damage(); boss.Damage(); boss.Damage(); boss.Damage(); boss.Damage(); boss.Damage(); //Bolt Queuing Destroy(other.gameObject); SoundManager.PlaySound("Explosion"); } else if (other.gameObject.tag.Equals("ship")) { MenuManager.DeadMenu(); PlaneParticles.Particles(); Debug.Log(other.gameObject.tag); other.gameObject.SetActive(false); SoundManager.PlaySound("Explosion"); GameHazard.playeralive = false; } }