Unity3d-打飞机:处理子弹

using UnityEngine;
using System.Collections;

public class Bullet : MonoBehaviour {
public float speed=2f;
// Use this for initialization
void Start () {

}

// Update is called once per frame
void Update () {
this.transform .Translate (Vector3 .up * speed * Time.deltaTime);//移动当前物体
if (transform .position .y > 5.6f) {
Destroy (this.gameObject ); //销毁当前物体
}
}
}

posted @ 2015-04-27 19:42  Kim-teng  阅读(340)  评论(0编辑  收藏  举报