public Ingredient Use(Player player) { if (pIngredient != null) { if (player.pIngredientsInHand != null) { if (player.pIngredientsInHand.Count < player._CarryLimit) { player.pIngredientsInHand.Enqueue(pIngredient); pIngredient.DestroyObject(); player.HoldIngredient(pIngredient); pIngredient = null; } } else { } } else { if (player.pIngredientsInHand != null && player.pIngredientsInHand != null && player.pIngredientsInHand.Count != 0) { pIngredient = player.pIngredientsInHand.Dequeue(); pIngredient.PlaceObject(_InstanceTransform); } } return(null); }
public Ingredient Use(Player player) { if (player.pIngredientsInHand != null && player.pIngredientsInHand.Count > 0) { Ingredient ingredient = player.pIngredientsInHand.Dequeue(); if (ingredient != null) { if (!ingredient.HasStatus(Ingredient.IngredientStatus.CHOPPED)) { ingredient.PlaceObject(_InstanceTransform); StartCoroutine("Chop", ingredient); } } } else { player.pIngredientsInHand = pChoppedIngredients; } return(null); }