publicclass MuTiClone : MonoBehaviour
{
//因为是public,会在Inspector中看到这个属性,对应一个游戏对象public GameObject go;
// Use this for initializationvoid Start () {
}
// Update is called once per framevoid Update () {
if (Input.GetKeyUp(KeyCode.Space))
{
//当我们抬起空格键的时候 开始克隆 GameObject.Instantiate(go, gameObject.transform.position, gameObject.transform.rotation);
}
}
}