예제 #1
0
        void Update()
        {
            // Отрисовка экипированных предметов.
            foreach (var item in _equippedItemSlots)
            {
                item.Key.BackgroundSpriteIsActive(false);
                if (InventoryService.IsEquipped(item.Value))
                {
                    item.Key.IsWithItem = true;
                    item.Key.SetMainSprite(
                        _resourceManager.GetSprite(
                            InventoryService.GetEquipped(item.Value).ImageId));
                }
                else
                {
                    item.Key.IsWithItem = false;
                    item.Key.SetMainSprite(null);
                }
            }
            _soulShotSlot.BackgroundSpriteIsActive(false);
            var soulShot = InventoryService.Inventory.SoulShot;

            if (soulShot != null)
            {
                _soulShotSlot.IsWithItem = true;
                _soulShotSlot.SetMainSprite(
                    _resourceManager.GetSprite(soulShot.ImageId));
            }
            else
            {
                _soulShotSlot.IsWithItem = false;
                _soulShotSlot.SetMainSprite(null);
            }
            ActiveSlotUpdate();
        }
예제 #2
0
        private void ActiveSlotUpdate()
        {
            if (InventoryService == null || _activeSlot == null)
            {
                return;
            }

            if (_activeSlot.IsWithItem)
            {
                _activeSlot.BackgroundSpriteIsActive(true);
                ActiveSlotDescription.text = InventoryService.Get(GetIndexOfInventorySlot(_activeSlot))
                                             .ToString();
            }
            else
            {
                _activeSlot.BackgroundSpriteIsActive(false);
                ActiveSlotDescription.text = string.Empty;
            }
        }
예제 #3
0
        /// <summary>
        /// Отрисовка выбранного предмета.
        /// </summary>
        private void ActiveSlotUpdate()
        {
            if (_activeSlot == null)
            {
                return;
            }

            if (_activeSlot.IsWithItem)
            {
                _activeSlot.BackgroundSpriteIsActive(true);

                ActiveSlotDescription.text = _activeSlot == _soulShotSlot
                    ? InventoryService.Inventory.SoulShot.ToString()
                    : InventoryService.GetEquipped(_equippedItemSlots[_activeSlot]).ToString();
            }
            else
            {
                ActiveSlotDescription.text = string.Empty;
                _activeSlot.BackgroundSpriteIsActive(false);
            }
        }