using UnityEngine;
using UnityEngine.AI;
public class ZombeAI : MonoBehaviour
{
[SerializeField] float _distance;
[SerializeField] NavMeshAgent _agent;
[SerializeField] Transform _target;
private void Update()
{
RaycastHit hit;
if(Physics.Raycast(transform.position, (_target.transform.position - transform.position), out hit, _distance))
{
if(hit.transform == _target) {
_agent.enabled = true;
_agent.SetDestination(_target.position);
}
}
}
}
public class InventoryCell : MonoBehaviour, IPointerClickHandler
{
[SerializeField] private TMP_Text _amountText;
[SerializeField] private Image _iconField;
[HideInInspector] public UIInventory _uiInventory = new UIInventory();
[HideInInspector] public Item _item = new Item();
public void OnPointerClick(PointerEventData eventData)
{
_uiInventory.RenderDescription(_item);
}