private GridCell gridCell; // prefab private void Awake() { RectGrid grid = GetComponent <RectGrid>(); grid.Generate(gridCell); }