What Rick has shown here is perfect for this layout of the arkynoid game, but a more robust method would be to use a for loop, and an array/list to cycle through the sprites. I’m using a list here:
[SerializeField] list<SpriteRenderer> hitSprite;
//other bits of code
//the method
int spriteIndex = hitSprite.Count;
for(int a = 0; a < spriteIndex; a++)
{
GetComponent<SpriteRenderer>().sprite = hitSprite[a];
}
So something like the above. Also like we’ve been taught, the SerializeField makes selecting objects so much simpler and with arrays and lists you can set the size in the inspector (without doing the code). Gives a good mix between programming and game design.