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…