Пример #1
0
 void PopulateSlot(IRecipeSlot slot, ElementStackToken stack)
 {
     stack.lastTablePos = new Vector2?(stack.RectTransform.anchoredPosition);
     if (stack.Quantity != 1)
     {
         var newStack = stack.SplitAllButNCardsToNewStack(stack.Quantity - 1, new Context(Context.ActionSource.PlayerDrag));
         slot.AcceptStack(newStack, new Context(Context.ActionSource.PlayerDrag));
     }
     else
     {
         slot.AcceptStack(stack, new Context(Context.ActionSource.PlayerDrag));
     }
 }
Пример #2
0
 private void RecipeSlotAction(IRecipeSlot slot)
 {
     if (!cookingList.Full)
     {
         cookingList.AddItem(slot.Item);
         TakeRequiredIngredients(slot.Item);
         RefreshRecipeRequirements();
     }
     else
     {
         //TODO move to game warning notification
         Debug.LogWarning("Max cookable item reached!");
     }
 }