private void ReleaseGrabbing()
 {
     Debug.Log("RELEASING!!!");
     gameObject.SendMessage("OnRelease", GrabbingHandRef.GetComponent <IHandGesture>().GetVelocity(), SendMessageOptions.DontRequireReceiver);
     transform.parent = null;
     grabbed          = false;
     if (animalComponentRef != null)
     {
         // animalComponentRef.ExitBusy();
         animalComponentRef.ExitBusyWithStateChange(new WanderAround(animalComponentRef.GetComponent <NavMeshAgent>(), animalComponentRef.GetSpeed(), animalComponentRef));
     }
 }
    public void Execute()
    {
        var hitObjects = Physics.OverlapSphere(animal.gameObject.transform.position,
                                               searchRadius, searchLayer);

        if (hitObjects.Length == 0)
        {
            // Just wandering around if no food given
            //if (animal.GetEnergyLevel() < 20f)
            //{
            //    animal.GetStateMachine().SwtichToPreviousState();
            //    return;
            //}
            //else
            //{
            if (wanderAround.ExecuteManually())
            {
                if (anim != null)
                {
                    // Debug.Log("searching for stuff...");
                    anim.Play(animationStr);
                }
            }
            //}
            return;
        }

        if (animal.GetHungerLevel() > 80.0f)
        {
            // Debug.Log("no longer needs to search for food");
            // Debug.Break();
            // animal.GetStateMachine().SwtichToPreviousState();
            // animal.GetStateMachine().ChangeState(wanderAround);
            animal.ExitBusyWithStateChange(wanderAround);
            return;
        }

        var index = -1;

        // Better performance than foreach
        for (int i = 0; i < hitObjects.Length; i++)
        {
            if (hitObjects[i].CompareTag(tagToLookFor))
            {
                agent.SetDestination(hitObjects[i].transform.position);
                if (Vector3.Distance(new Vector3(animal.gameObject.transform.position.x, animal.gameObject.transform.position.y, 0f),
                                     new Vector3(hitObjects[i].transform.position.x, hitObjects[i].transform.position.y, 0f)) < 1f)
                {
                    index = i;
                    break;

                    // Debug.Log(animal.GetStateMachine().GetCurrentState());
                }
            }
        }

        if (index > -1)
        {
            animal.GetStateMachine().ChangeState(new EatingFood(hitObjects[index].gameObject.GetComponent <Food>(),
                                                                foodConsumingRate, agent, animal));
        }
    }