コード例 #1
0
        protected virtual void InitInventory()
        {
            Slot arrowSlot = new Slot(ConsumableType.Arrow, GameConfig.arrowInventorySize);

            arrowSlot.StockItem = GameConfig.initialArrows;

            Slot bombSlot = new Slot(ConsumableType.Bomb, GameConfig.smokeBombInvertorySize);

            bombSlot.StockItem = GameConfig.initialBombs;

            CharacterInventoryComponent characterInventory = RequestComponent <CharacterInventoryComponent>();

            characterInventory.AddSlot(arrowSlot);
            characterInventory.AddSlot(bombSlot);
        }
コード例 #2
0
 private void Start()
 {
     inventoryComponent = inventoryCarrier.RequestComponent <CharacterInventoryComponent>();
 }