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) { 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); } }
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); } }