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

public class PDAEnable : MonoBehaviour
{
    public static System.Action<bool> OnPDAStateChange;

    [SerializeField] Animator Animator;

    private bool _enabled = false;

    private void Awake()
    {
        Animator.SetBool("Enabled", false);
    }

    private void Update()
    {
        if (Input.GetKeyDown(KeyCode.Tab))
            ChangeState();
    }

    private void ChangeState()
    {
        _enabled = !_enabled;
        Animator.SetBool("Enabled", _enabled);
        OnPDAStateChange?.Invoke(_enabled);
    }
}
