update sprites for multiple similar objects. Need help

Hi guys,

I am new to unity and I am trying to update multiple coin sprites in a game. Where all of them look the same and need to be changed to different sprite based on an IF condition.

I am able to change sprites of single objects but unable to change for multiple objects in one go. So i would like to know whats the best way to do this.

for single game object i am using GetComponent ()sprite = NewSprite;

child all coins to one gameobject. put the script on the new parent. instead of GetComponent use GetComponentsInChildren. iterate the returned list and change each item.