Beispiel #1
0
        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)
                );
        }
        void Awake()
        {
            if (instance != null)
            {
                Destroy(this);
            }
            instance = this;

            inventoryData = GameObject.Find("GameData").GetComponent <InventoryData>();
            Debug.Log(inventoryData);
            itemSlot       = Resources.Load <GameObject>("ItemSlot");
            dessertSlot    = Resources.Load <GameObject>("DessertSlot");
            ingredientSlot = Resources.Load <GameObject>("ingredientSlot");

            ingredientList = new List <Item>();
        }