克隆 original 对象并返回此克隆。
original
public static Object Instantiate( Object original, Transform parent, bool instantiateInWorldSpace );
true
false
public static Object Instantiate( Object original, Vector3 position, Quaternion rotation, Transform parent );
示例
using UnityEngine; public class Example : MonoBehaviour { public GameObject prefab; void Start() { for (var i = 0; i < 10; i++) { Instantiate(prefab, new Vector3(i * 2.0f, 0, 0), Quaternion.identity); } } }