In the Unity game engine (let's say Version 4.6 and above), create a grid with an object of your choice.
Attach the script to an object in the scene.
Create the object you'd like the grid to be made of.
Optionally add a parent to the objectParent field so that the objects don't take over your hierarchy.
Click "buildGrid" in the inspector.