void OnTriggerEnter(Collider other) { if (other.tag == "Bolt") { Destroy(gameObject); //Auto destroy InfoScript.IncreaseScore(); //Increases score Destroy(other.gameObject); //Destroys Bolt energyBlast = (GameObject)Instantiate(energyBlast, transform.position, transform.rotation); //Instiate explosion Destroy(energyBlast, 1); } }
void OnTriggerEnter(Collider other) { if (other.tag == "Player") { Destroy(gameObject); //Auto destroy Destroy(other.gameObject); //Destroys Player gameController.DecreasePlayerLife(); //Decreases Player's Life } if (other.tag == "Bolt") { Destroy(gameObject); //Auto destroy InfoScript.IncreaseScore(); //Increases Score Destroy(other.gameObject); frameBall = (GameObject)Instantiate(frameBall, transform.position, transform.rotation); Destroy(frameBall, 1); } }
void OnTriggerEnter(Collider other) { if (other.tag == "Player") { Destroy(gameObject); //Auto destroy playerController.CallFreezePlayer(); skillAttack2 = (GameObject)Instantiate(skillAttack2, transform.position, transform.rotation); Destroy(skillAttack2, 1); } if (other.tag == "Bolt") { Destroy(gameObject); //Auto destroy InfoScript.IncreaseScore(); //Increases score by 10 Destroy(other.gameObject); //Destroys Bolt skillAttack2 = (GameObject)Instantiate(skillAttack2, transform.position, transform.rotation); Destroy(skillAttack2, 1); } }
void OnTriggerEnter(Collider other) { if (other.tag == "Player") { Destroy(gameObject); //Auto destroy Destroy(other.gameObject); //Destroys Player Spark = (GameObject)Instantiate(Spark, transform.position, transform.rotation); Destroy(Spark, 1); } if (other.tag == "Bolt") { Destroy(gameObject); //Auto destroy InfoScript.IncreaseScore(); //Increases score Destroy(other.gameObject); //Destroys Bolt Spark = (GameObject)Instantiate(Spark, transform.position, transform.rotation); Destroy(Spark, 1); } }