コード例 #1
0
    public void SetFromRecipe(Factory.Recipe recipe)
    {
        SetTitleFromRecipe(recipe);

        UI.MakeItemInfos(input, recipe?.input);
        UI.MakeItemInfos(output, recipe?.output);
    }
コード例 #2
0
    public void SetFromRecipeInventory(Factory.Recipe recipe, Inventory inventory)
    {
        SetTitleFromRecipe(recipe);

        UI.MakeItemInfos(input, recipe?.input.Select(info => (info.name, info.count, (uint?)inventory.Count(info.name))).ToList());
        UI.MakeItemInfos(output, recipe?.output);
    }
コード例 #3
0
 public void SetTitleFromRecipe(Factory.Recipe recipe)
 {
     if (recipe == null)
     {
         title.text = "No Recipe";
     }
     else
     {
         title.text = recipe.name;
     }
 }
コード例 #4
0
    void ConsumeRecipe(Factory.Recipe recipe, int index)
    {
        factory.recipes.RemoveAt(index);

        factory.SetSelectedRecipe(index);
    }