public static GameObject CreateGameObject(string name, params Type[] types) { GameObject gameObject = ObjectFactory.CreateDefaultGameObject(name); gameObject.SetActive(false); for (int i = 0; i < types.Length; i++) { Type type = types[i]; ObjectFactory.AddComponent(gameObject, type); } gameObject.SetActive(true); return(gameObject); }