How to use the GameObject's construction function in C#

static function GameObject (name : string, params components : Type[]) : GameObject Description Creates a game object and attaches the specified components.

I don't know what can pass to the second param.

Weird - that isn't a static function, it's a constructor


GameObject go = new GameObject("Test", typeof(MeshRenderer), typeof(MeshFilter), typeof(YourScript));

params just turns all the parameters from there on into a single array internally, making life much easier when the number of parameters can be variable