Create procedural mix & match gameobjects

I apologize if this question somehow totally misses the point, I’m new at Unity3d.

I want to randomly assemble gameobjects procedurally from a big variety of shapes, textures, and even animations.

Assuming I have a project with a bunch of these assets, how can I do this through scripting? I understand how to create a new empty game object through scripting, but I don’t see examples of how to then select an existing imported shape asset etc to fill it out. Can someone point to a robust example?

var materials : Material;
var meshes : Mesh;

function Start () {
    var object = new GameObject("go", MeshFilter, MeshRenderer);
    object.renderer.material = materials[Random.Range(0, materials.Length)];
    object.GetComponent(MeshFilter).mesh = meshes[Random.Range(0, meshes.Length)];
}