public static void setContents(this UIScrollView view, UIGrid grid, IEnumerable<GameObject> newContents) { if (view == null || newContents == null) { throw new System.ArgumentNullException(); } view.ResetPosition(); if (grid != null) { grid.setContents (newContents); } else { setContents(view.gameObject, newContents); } view.ResetPosition(); }