Syntax help using CreateGameObjectWithHideFlags


I working on an editor script where I need to create a couple of empty gameobjects. I'd like to use CreateGameObjectWithHideFlags, but I can't figure the syntax for the 3rd argument: params components : Type[]

CreateGameObjectWithHideFlags (name : string, flags : HideFlags, params components : Type[]) : GameObject

I've been trying System.Type.GetType("GameObject"), but I get the error, AddComponent is requesting invalid type.



Think you need to feed it an array of components (or just one) e.g. using the GetComponent(TypeName) function.