get object by tag name unity and loop function for each one code example
Example: unity get all by tag
GameObject[] arrayGo = GameObject.FindGameObjectsWithTag("myTag");
GameObject[] arrayGo = GameObject.FindGameObjectsWithTag("myTag");