public void AssignReferenceOfObjectInGridNxtPositionEditor(int direction) { Coordinate aux; for (int j = 0; j < count; j++) { aux = currentBlockGroup[j]; switch (direction) { case 0: roomGrid.SetReferenceOfObject(aux.x, aux.y - 1, type, gameObject); break; case 1: roomGrid.SetReferenceOfObject(aux.x + 1, aux.y, type, gameObject); break; case 2: roomGrid.SetReferenceOfObject(aux.x, aux.y + 1, type, gameObject); break; case 3: roomGrid.SetReferenceOfObject(aux.x - 1, aux.y, type, gameObject); break; } } }