Wait for animation end - Sprite Manager 2

Hi,

is it possible to stop the excecution of a script as long as an animation is playing?

something like this:

if (XXX)
{
  mySprite.PlayAnim(0);
  //function wich stops the script, as long as the animation plays
  //function after animation is done
}

Thanks

make empty object , attact script with it
create required script Instance like
private ScriptName object;
then get components of required that you want to disables …
in start function
object.GetComponent();
then write after animation complete
object.enabled = false ;

hope you understand , advance sory if any mistake bcz its my first atempt to answer …