Exemplo n.º 1
0
        //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);
        }
Exemplo n.º 2
0
    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);
    }
Exemplo n.º 3
0
 public override void UI_Interact(GameObject originator, string hand)
 {
     food.TryEat();
 }