示例#1
0
        public override void ConfigureSlot(Item item, SlotManager slotManager)
        {
            base.ConfigureSlot(item, slotManager);
            // Replace the default action with buy.

            slotManager.ResetButtonAction();

            slotManager.SetButtonText("Buy");
            slotManager.SetName($"{item.GetName()} - {item.GetValue()/100f:c2}");

            slotManager.IsButtonEnabled(_playerBalance.GetBalance() >= item.GetValue());
            slotManager.SetBuyItem(_playerInventory, _playerBalance, item, this);
        }
        public virtual void ConfigureSlot(Item item, SlotManager slotManager)
        {
            slotManager.SetName(item.GetName());
            slotManager.SetDescription(item.GetDescription());
            slotManager.SetButtonText(item.GetAction());
            slotManager.SetSprite(item.GetSprite());
            slotManager.IsButtonEnabled(true);

            if (item.GetType() == typeof(Food))
            {
                slotManager.SetEatItem((Food)item, _playerEating);
            }
        }