using System.Collections;
using System.Collections.Generic;
using UnityEngine;

public class KnockedOutState : MonoBehaviour
{
    public IdleState IdleState;
    private float timer;
    public float Duration;
    public Animator Animator;

    // Start is called before the first frame update
    void OnEnable()
    {
        timer = 0;
        if(Animator != null)
            Animator.Play("Base Layer.Killed");
    }

    // Update is called once per frame
    void Update()
    {
        timer += Time.deltaTime;
        if(timer > Duration)
        {
            enabled = false;
            IdleState.enabled = true;
        }
    }
}
