IEnumerator BulletDeath() { yield return(new WaitForSeconds(bulletTime.destroyBulletTime)); isHalo = true; GameObject newLight = Instantiate(LightPrefab, transform.position, Quaternion.identity); lightF = newLight.GetComponent <LightFade>(); lightF.bullet = this; lightF.setLightRange(); Destroy(this.gameObject); }
public void OnCollisionEnter(Collision collision) { if (collision.gameObject.tag == "Terrain") { isHalo = false; GameObject newLight = Instantiate(LightPrefab, transform.position, Quaternion.identity); lightF = newLight.GetComponent <LightFade>(); lightF.GetComponent <Light>().flare = null; lightF.bullet = this; lightF.setLightRange(); SED.StartScan(transform.position); Destroy(this.gameObject); } }