public void Awake() { if (instance != null) { Destroy(this); } instance = this; ingredientInventory = new List <Item>(); dessertInventory = new List <Item>(); otherInventory = new List <Item>(); myCookBook = new CookBook(); List <Item> recipe = new List <Item>(); Debug.Log("待解決bug:"); AddItem(new Item { itemName = Item.ItemName.糖, quantity = 0 }); AddItem(new Item { itemName = Item.ItemName.雞蛋, quantity = 0 }); AddItem(new Item { itemName = Item.ItemName.布丁, quantity = 0 }); myCookBook.GetCookBook().Add( Item.ItemName.布丁, new Recipe( new Item { itemName = Item.ItemName.雞蛋, quantity = 1 }, new Item { itemName = Item.ItemName.糖, quantity = 1 }, recipe) ); }
public Dictionary <Item.ItemName, Recipe> GetCookBook() { return(myCookBook.GetCookBook()); }