UnityEngine.GameObject[]' does not contain a definition for GetComponent

Hey. I want to start a coroutine over a list of gameobject which looks like this:

using UnityEngine;
using System.Collections;
using System.Linq;

public class AnimateSlots : MonoBehaviour {

	public GameObject[] m_Slots;
	public float delay;

	// Use this for initialization
	void Start () {
	
	}
	
	private void Update ()
	{

		GameObject[] m_TargetsGO = GameObject.FindGameObjectsWithTag("Slots").OrderBy( go => go.name ).ToArray();

		m_Slots = new GameObject[m_TargetsGO.Length];

		for(int i = 0; i < m_TargetsGO.Length; ++i)
		{
			m_Slots <em>= m_TargetsGO*;*</em>

* }*

* }*

* public void OnButtonClickedEvent ()*
* {*
* StartCoroutine(ActivateAnimation(0.2f));*
* }*

* IEnumerator ActivateAnimation(float delay)*
* {*
* for(int i = 0; i < m_Slots.Length; i++);
_
{_
m_Slots.GetComponent.Play(“slot_open”);*

* //You can adjust the dealy whn calling the coroutine*
* yield return new WaitForSeconds(delay);*
* }*
* }*
}

but i get the error:
error CS1061: Type UnityEngine.GameObject[]' does not contain a definition for GetComponent’ and no extension method GetComponent' of type UnityEngine.GameObject[]’ could be found (are you missing a using directive or an assembly reference?)
what did i wrong?

In your IEnumerator ActivateAnimation(float delay) you are using GetComponent on m_Slots which is an array which is why yo are getting this error. What you need is:

m_Slots*.GetComponent<Animator>().Play("slot_open");*

Notice the index in front of m_Slots.