Okay, you should read this thread before you start posting:
What do you mean you want “the script” to wait until the animation finishes playing? Do you want specific lines of code to only work, or everything?
The code you posted should be a fine starting point. You could simply declare a boolean variable called something like isFinishedAnim
and set it to false. Then at the end of the coroutine you posted, set isFinishedAnim
to true. To “pause” all of your script, just put an if statement:
if (isFinishedAnim)
before all your code you want to pause.
Let me know if that wasn’t clear enough