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;
}
}
}
网友评论