Beispiel #1
0
        public void Construct(Inventory inventory)
        {
            Inventory = inventory;
            List <InventoryItem> items = inventory.Items;

            Clear();

            foreach (var item in items)
            {
                InventoryItemDisplay display = Instantiate(ItemDisplayPrefab);
                display.transform.SetParent(TargetTransform, false);
                display.Construct(item);
            }
            Constructed = true;
        }
        public void Construct(HeroInventory heroInventory)
        {
            HeroInventory = heroInventory;
            gameObject.SetActive(true);

            if (Helmet != null)
            {
                Helmet.Construct(heroInventory.Helmet);
            }
            if (Armor != null)
            {
                Armor.Construct(heroInventory.Armor);
            }
            if (Weapon != null)
            {
                Weapon.Construct(heroInventory.Weapon);
            }
            if (Offhand != null)
            {
                Offhand.Construct(heroInventory.Offhand);
            }
        }