IState GameObjectToState(GameObject other, RaycastHit hit)
{
if (other.GetComponent<IInteractable>() != null)
{
return new InteractWithNearestState(_agent, other);
}
if (other.GetComponent<ICollectable>() != null)
{
return new PickupItemState(_agent, hit.transform.gameObject);
}
if(other.tag == Constants.Tags.Floor)
{
movementLight.transform.position = hit.point;
movementLight.GetComponent<Animator>().SetTrigger("Light");
return new GoSomewhereAndWaitState(_agent, hit.point);
}
return null;
}