How to Call Animation Sequece one by one using Delegates

Hi All

I am new bie to unity. In my project i have to call the animation Sequence one by one using delegate…i am trying the code…but it is not working…

using UnityEngine;
using System.Collections;


public class UnityExample: MonoBehaviour
{  

public Animation PlayerAnimation;
delegate void MyDelegate();
MyDelegate myDelegate;


public void Start()
{
myDelegate =Animation1;
}

}

// IS THERE ANY WAY CAN WE CALL IENUMERATOR METHOD IN DELEGATE...

// I HAVE TRIED  BUT IT  IS NOT WORKED.......

// SO I HAVE PASS TO  THE FUNCTION AND THEN I CALL  COROUTINE METHOD...

void Animation1()
{
StartCoroutine( AnimationCall());
}


public IEnumerator  AnimationCall()
    {
PlayerAnimation.PlayQueued("T_Healthy",QueueMode.PlayNow);
ImageAnim.SetBool("Fruit",true);
yield return new WaitForSeconds(1f);       
ParticleEffect.SetActive(false);
yield return new WaitForSeconds(0.9f);
    }

I am not getting errors. bu the animation sequece is not playing…how can i do it…

. I have to pass the animation sequence one by one… using delegates…

You never call either Animation1() or myDelegate(). Just assigning a delegate to a variable doesn’t call it.

That said, I suspect that delegates are the wrong way to go for this problem, though I can’t say for sure without a little more context as to what you want to accomplish.

One additional note: you’re using the Animation class, which is for legacy animation clips only and is almost certainly the wrong class. You most likely want to use an Animator instead.