Complete animation then continue script

ok, so im using ragepixel and im trying to get my animation to complete and then play another animation.

can you make the script to wait for like 2 seconds?

or is there lika a wait for animation to complete command that works with ragepixel?

like this?

using UnityEngine;
using System.Collections;

public class openbag : MonoBehaviour {
	
	private IRagePixel ragePixel;

	// Use this for initialization
	void Start () {
		ragePixel = GetComponent<RagePixelSprite>();
	}
	
	// Update is called once per frame
	void Update () {
		if (Input.GetKey(KeyCode.RightAlt))
		{
		        ragePixel.SetSprite("EQUIP");
			ragePixel.PlayNamedAnimation("EQUIP");
                        // wait for (animation to complete) then
                        ragePixel. PlayNamedAnimation("SOMETHING");
		}
	}
}

Use the animation queue:
PlayQueue Documentation
CrossFadeQueued Documentation

yield return new WaitForSeconds(animation.clip.length); use that btu not in the same update function, create a sparate function that is an IEnumerator.

using UnityEngine;

using System.Collections;

 

public class openbag : MonoBehaviour {

    

    private IRagePixel ragePixel;

 

    // Use this for initialization

    void Start () {

        ragePixel = GetComponent<RagePixelSprite>();

    }

    

    // Update is called once per frame

    void Update () {

        if (Input.GetKey(KeyCode.RightAlt))

        {

                ragePixel.SetSprite("EQUIP");

            ragePixel.PlayNamedAnimation("EQUIP");

                        // wait for (animation to complete) then

                        ragePixel. PlayNamedAnimation("SOMETHING");
                        yield return new WaitForSeconds(animation.clip.length); // use this, but NOT in the UPDATE function, create a separate function that is an IEnumerator
        }

    }

}