Ejemplo n.º 1
0
 private void  OnChoppableItemOnBoardPickedUp(HoldableItem itemOnBoard)
 {
     if (itemOnBoard.HoldingState == HoldableItem.HeldState.Held)
     {
         itemOnBoard.OnHoldStateChange.RemoveListener(OnChoppableItemOnBoardPickedUp);
         OnChoppableItemUnboarded.Invoke(choppableItemOnBoard);
         choppableItemOnBoard = null;
     }
 }
Ejemplo n.º 2
0
    private void OnChoppingEnded(Choppable itemChopped)
    {
        Debug.Log("End of chop");
        // Call the on chop ending event
        OnChopEnding.Invoke(itemChopped);

        if (itemChopped.ChopComplete)
        {
            Debug.Log("Item chop complete");
            FoodGameObject choppedResult = Instantiate(itemChopped.ChoppedIngredient.IngredientPrefab, itemChopped.transform.position, itemChopped.transform.rotation);
            choppedResult.transform.parent = itemChopped.transform.parent;
            choppedResult.GetHoldableItemComponent().ToggleRigidBodyKinematic(true);
            OnChoppableItemUnboarded.Invoke(itemChopped);
            Destroy(itemChopped.gameObject);
        }

        _activeChoppingState = null;
    }