Waiting inside static class

Hi everyone,

I’m working on a little pokemon clone and I kinda hit a wall at the battle system. After you choose an attack, the enemy chooses an attack as well, the pokemon which is faster goes first and (here is my problem) the second attack has to wait until the player presses the text box that explains what happened away. So for clarification: Pokemon 1 attacks, game waits for player to read through the text and click it away, Pokemon 2 attacks, game waits for player to read through the text and click it away, next round starts.

Now to the problem: Everything works fine except for the waiting for the player input. Right now both Pokemon just attack eachother in the same frame. I have the actions saved in a dictionary which I sorted acording to the turn order and I go through the dictionary with a foreach loop and trigger all attacks saved in there and what I want is to just block the foreach loop until the player input without blocking the entire game. I tried working with coroutines but i couldnt get it to work properly since its inside a static class.

Here are the important script parts:

private static void DoActions()
    {
        // insided the variable queuedActions are the attacker and defender as the key and the action/attack in the value
        foreach (KeyValuePair<Linomon[], Action> kv in queuedActions)
        {
            // Use the action with the first pokemon as attacker and second as defender
            kv.Value.UseAction(kv.Key[0], kv.Key[1]);
            
            // This doesnt work yet but should block the loop until the input
            TextBox.WaitForTextBoxToClose();
        }
        TurnEnd();
    }

and this one is inside the TextBox class

public static void WaitForTextBoxToClose()
    {
        while(content.activeSelf == true)
        {

        }
    }

and the TextBox class basically just shows some text and if the user clicks it goes on to the next text and if there is no text left it closes itself (sets active of content to false) so as soon as the player closes the text it should get out of the while loop and continue with the next attack inside the DoActions method but again since the while loop blocks the entire game the player cant click to continue the text anymore.

Any help would be much appreciated. Thanks for your time reading this and trying to help me

Oh well solved it myself by just changing the static class into a normal one and used coroutine