why ienumerator Dont working

void Start()
{
StartCoroutine(Stest());
}
public void test()
{

}
IEnumerator Stest()
{
    i.SetActive(true);
    yield return new WaitForSeconds(2.0f); // dont working
    i.SetActive(false);
    yield return Stest();
}

IEnumerator Stests()
{
    Debug.Log("aaaa");
    i.SetActive(true);
    yield return null;
}

What’s exactly not working? You marked the WaitForSeconds line however that doesn’t make much sense. Note that your two coroutines are pretty pointless anyways because after you wait 2 seconds you deactivate “i” and inside your second coroutine you immediately activate it again, so it’s never really deactivated.

If your coroutine is actually “stuck” at the yield return line, the reason is either that you have set Time.timeScale to 0 in which case time is frozen and WaitForSeconds would never finish since the time is halted. The other reason may be that you deactivate or destroy the gameobject this coroutine runs on which would terminate the coroutine. You haven’t given any details what is not working or what exactly is happening.