Example #1
0
    bool IsCarryingFood()
    {
        FoodObject fo = GetComponentInChildren <FoodObject>();

        if (fo != null)
        {
            if (carriedFood == null)
            {
                carriedFood = fo;
            }
            if (fo.Id != carriedFood.Id)
            {
                carriedFood.Destroy();
                carriedFood = fo;
            }
            return(true);
        }
        else
        {
            return(false);
        }
    }