private void OnChoppableItemOnBoardPickedUp(HoldableItem itemOnBoard) { if (itemOnBoard.HoldingState == HoldableItem.HeldState.Held) { itemOnBoard.OnHoldStateChange.RemoveListener(OnChoppableItemOnBoardPickedUp); OnChoppableItemUnboarded.Invoke(choppableItemOnBoard); choppableItemOnBoard = null; } }
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; }