Script-点击鼠标左键触发
2017-08-31 本文已影响8人
zcwfeng
public class Test : MonoBehaviour {
public GameObject getBulle;
GameObject bullet;
// Use this for initialization
void Start () {
}
// Update is called once per frame
void Update () {
if (Input.GetButton ("Fire1")) {
bullet = Instantiate (getBulle);
bullet.transform.parent = this.transform;
}
}
}