コード例 #1
0
    public void UnlockRecipe(Recipe recipe, bool showUnlock)
    {
        for (int i = 0; i < SaveLoad.Instance.Recipe_Item.Count; i++)
        {
            RecipeData r = SaveLoad.Instance.Recipe_Item[i].GetComponent <RecipeData>();
            if (r.recipe.Name == recipe.Name && r.recipe.Unlocked == false)
            {
                r.recipe.Unlocked = true;
                SaveLoad.Instance.Recipe_Item[i].SetActive(true);
                Button.interactable = false;

                if (showUnlock == true)
                {
                    gameObject.GetComponent <RecipeUnlock>().Set(
                        r.recipe.Name,
                        r.StringBuilder(),
                        r.recipe.SellValue.ToString());
                }
            }
        }

        MoveAllItemToInventory();
    }