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

public class ShowHelp : MonoBehaviour
{
    [SerializeField] private String _helpText;
    [SerializeField] private TMPro.TextMeshProUGUI _helpTextUI;

    private void Awake()
    {
        Assert.IsFalse(String.IsNullOrEmpty(_helpText));
        _helpTextUI.SetText(_helpText);
        _helpTextUI.enabled = false;
    }

    private void OnTriggerEnter(Collider other)
    {
        if (!other.name.Equals("Player"))
        {
            return;
        }
       _helpTextUI.enabled = true; 
    }

    private void OnTriggerExit(Collider other)
    {
        _helpTextUI.enabled = false;
    }
}
