unity spawn game object code example
Example 1: unity create gameobject
// Use 'new GameObject' to create a new GameObject in the current scene
SpawnedObject = new GameObject("Created GameObject");
Example 2: unity instantiate prefab
Instantiate(cube, Vector3 (x, y, 0), Quaternion.identity);