Method Spawn
Spawn(GStylizedTerrain, GameObject, Vector3, Transform)
Instantiate a cloned object of a prefab and place it under the terrain. This function also records undo in the editor.
public static GameObject Spawn(GStylizedTerrain terrain, GameObject prototype, Vector3 worldPos, Transform parent = null)
Parameters
terrainGStylizedTerrainThe terrain object.
prototypeGameObjectThe prefab.
worldPosVector3World position of spawned object.
parentTransformParent transform of spawned object. If null, a default root object will be used.
Returns
- GameObject
The spawned object.