//Check if the item is edible and eat it private bool CheckEdible() { FoodBehaviour baseFood = CurrentSlot.Item.GetComponent <FoodBehaviour>(); if (baseFood != null) { baseFood.TryEat(); return(true); } return(false); }
private bool CheckEdible(GameObject itemInHand) { FoodBehaviour baseFood = itemInHand.GetComponent <FoodBehaviour>(); if (baseFood == null || UIManager.CurrentIntent == Intent.Harm) { return(false); } if (PlayerManager.LocalPlayer == gameObject) { //Clicked on yourself, try to eat the food baseFood.TryEat(); } else { //Clicked on someone else //TODO create a new method on FoodBehaviour for feeding others //and use that here } return(true); }
public override void UI_Interact(GameObject originator, string hand) { food.TryEat(); }