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

public class AnimationHandler : MonoBehaviour
{
    Animator animator;
    int isDoorOpenHash;

    // Start is called before the first frame update
    void Start()
    {
        animator = gameObject.GetComponent<Animator>();
        isDoorOpenHash = Animator.StringToHash("isDoorOpen");
    }

    // Update is called once per frame
    void Update()
    {
        if (Input.GetKeyDown(KeyCode.Space))
        {
            animator.SetBool(isDoorOpenHash, true);
        }

        if (Input.GetKeyDown(KeyCode.S))
        {
            animator.SetBool(isDoorOpenHash, false);
        }
    }
}
