using UnityEngine; using System.Collections; public class InitGameObject : MonoBehaviour { public GameObject bullet; void Update() { if (Input.GetKeyDown (KeyCode.Space)) { //通过预设体生成游戏对象(预设体,位置,旋转(四元数)) GameObject blt = Instantiate(bullet, new Vector3(1,0,0), Quaternion.identity) as GameObject; Debug.Log (blt.name); } } }