- var BulletPoint:Transform;
- var BulletXG:GameObject;
- var BulletSound:GameObject;
- function Update () {
-
- }
- function OnCollisionEnter(collisionInfo : Collision) {
- if(BulletXG&&BulletPoint)
- {
- var Clone:GameObject=Instantiate(BulletXG,BulletPoint.transform.position,transform.rotation);
- var CloneSound:GameObject=Instantiate(BulletSound,BulletPoint.transform.position,transform.rotation);
- if(CloneSound)
- {
- Destroy(CloneSound,2);
- }
- }
- Destroy(this.gameObject);
- }
复制代码 |