void OnCollisionEnter(Collision collision) { pon = collision.gameObject.GetComponent<IAPon>(); if(pon != null) pon.Damage(damage); }
void OnCollisionEnter(Collision collision) { pon = collision.gameObject.GetComponent <IAPon>(); if (pon != null) { pon.Damage(damage); } }
void OnCollisionEnter(Collision collision) { IAPon pon = collision.gameObject.GetComponent <IAPon>(); if (pon != null) { Damage(pon.GetDamage()); Destroy(pon.gameObject); } }
void OnCollisionEnter(Collision collision) { pon = collision.gameObject.GetComponent<IAPon>(); if(pon != null) pon.Damage(damage); if(type == "minigun") Destroy(gameObject); if(type == "plasma") { FX = Instantiate(Resources.Load("Prefab/PlasmaFX")) as GameObject; FX.transform.position = transform.position; FX.transform.parent = GameObject.FindGameObjectWithTag("GameController").transform; Destroy(FX, 0.25f); Destroy(gameObject); } }
public void genereTower(int i) { foreach (GameObject po in Niveau.pons) { UnityEngine.Object.Destroy(po); } Tower tow = this.indiv [i].transform.GetChild(0).GetComponent <Tower> (); this.indiv[i].transform.GetChild(0).tag = "Tower"; this.indiv[i].transform.GetChild(0).GetComponent <MeshRenderer> ().enabled = true; this.indiv[i].transform.GetChild(0).gameObject.GetComponent <MeshCollider> ().enabled = true; tow.enabled = true; Niveau.generate = true; tow.generation(); GameObject.Find("GameController").GetComponent <Timer>().time = 0; IAPon.Initialize(); }
void OnCollisionEnter(Collision collision) { pon = collision.gameObject.GetComponent <IAPon>(); if (pon != null) { pon.Damage(damage); } if (type == "minigun") { Destroy(gameObject); } if (type == "plasma") { FX = Instantiate(Resources.Load("Prefab/PlasmaFX")) as GameObject; FX.transform.position = transform.position; FX.transform.parent = GameObject.FindGameObjectWithTag("GameController").transform; Destroy(FX, 0.25f); Destroy(gameObject); } }