Method Spawn
Spawn(GameObject)
Instantiates a GameObject, preserving prefab linkage in the editor when the source object is a prefab asset.
public static GameObject Spawn(GameObject original)
Parameters
originalGameObjectPrefab asset or scene object to instantiate.
Returns
- GameObject
The spawned GameObject.
Remarks
In the editor this method also registers Undo for the created object. Outside the editor it falls back to a normal runtime instantiate.