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

public class stealthBox : MonoBehaviour
{
    private BlackBoard m_blackboard;
    // Start is called before the first frame update
    void Start()
    {
        m_blackboard = (BlackBoard)FindObjectOfType(typeof(BlackBoard));
    }

    private void OnTriggerEnter(Collider other)
    {
        if(other.CompareTag("Player"))
            m_blackboard.PlayerHide(true);
    }

    private void OnTriggerExit(Collider other)
    {
         if(other.CompareTag("Player"))
             m_blackboard.PlayerHide( false);
    }

    private void OnDrawGizmos()
    {
        Gizmos.color = Color.red;
        Gizmos.DrawWireCube(transform.position, transform.localScale);
    }
}
