Ejemplo n.º 1
0
    protected IEnumerator CoroutineIdle(float time, string animation = "idle")
    {
        interrupt = false;
        animator.PlayAnimation(animation);
        timer = time;
        while (timer > 0)
        {
            timer -= Time.deltaTime;
            yield return(null);

            if (interrupt)
            {
                break;
            }
        }
    }
Ejemplo n.º 2
0
    void Start()
    {
        Animator2D animator = null;

        if (!animator_on_child)
        {
            animator = gameObject.GetComponent <Animator2D>();
        }
        else
        {
            animator = gameObject.GetComponentInChildren <Animator2D>();
        }

        if (animator != null)
        {
            animator.PlayAnimation(animation_to_play, speed, loop);
        }
    }
Ejemplo n.º 3
0
 // Use this for initialization
 void Start()
 {
     _anim = GetComponent<Animator2D>();
     _anim.PlayAnimation("idle");
 }
Ejemplo n.º 4
0
 // Use this for initialization
 void Start()
 {
     _anim = GetComponent<Animator2D> ();
     _anim.PlayAnimation ("left");
     _pos = transform.position;
 }
Ejemplo n.º 5
0
 // Start is called before the first frame update
 void Start()
 {
     animator.PlayAnimation("Idle", 0.1F);
     rb = GetComponentInParent <Rigidbody2D>();
 }
Ejemplo n.º 6
0
 public void OnStartDrawing()
 {
     animator.PlayAnimation("cast");
 }