Пример #1
0
        public void SetByArmorId(int armorId)
        {
            var image = SpriteHelper.GetItemIcon(armorId);

            if (image is null)
            {
                throw new FailedToLoadResourceException <Sprite>(armorId.ToString());
            }

            SetIcon(image);
        }
Пример #2
0
        public void Show(ArenaInfo enemyInfo)
        {
            var player = Game.Game.instance.Stage.GetPlayer();
            var sprite = SpriteHelper.GetItemIcon(player.Model.armor?.Id ?? GameConfig.DefaultAvatarArmorId);

            profile.Set(player.Level, States.Instance.CurrentAvatarState.NameWithHash, sprite);
            var enemySprite = SpriteHelper.GetItemIcon(enemyInfo.ArmorId);

            enemyProfile.Set(enemyInfo.Level, enemyInfo.AvatarName, enemySprite);

            base.Show();
        }
        public void Show(ArenaInfo enemyInfo)
        {
            player = Game.Game.instance.Stage.GetPlayer();
            var sprite = SpriteHelper.GetItemIcon(player.Model.armor? .Id ?? GameConfig.DefaultAvatarArmorId);

            playerProfile.Set(player.Level, States.Instance.CurrentAvatarState.NameWithHash, sprite);
            player.gameObject.SetActive(false);
            var enemySprite = SpriteHelper.GetItemIcon(enemyInfo.ArmorId);

            enemyProfile.Set(enemyInfo.Level, enemyInfo.AvatarName, enemySprite);
            loadingText.text = L10nManager.Localize("UI_MATCHING_OPPONENT");
            Show();
        }
Пример #4
0
        public virtual void SetData(ItemSheet.Row itemRow)
        {
            if (itemRow is null)
            {
                Clear();
                return;
            }

            Sprite gradeSprite;

            switch (imageSizeType)
            {
            case ImageSizeType.Small:
                gradeSprite = SpriteHelper.GetSmallItemBackground(itemRow.Grade);
                break;

            case ImageSizeType.Middle:
                gradeSprite = SpriteHelper.GetItemBackground(itemRow.Grade);
                break;

            default:
                throw new ArgumentOutOfRangeException(nameof(imageSizeType), imageSizeType, null);
            }
            gradeImage.overrideSprite = gradeSprite;

            var itemSprite = SpriteHelper.GetItemIcon(itemRow.Id);

            if (itemSprite is null)
            {
                throw new FailedToLoadResourceException <Sprite>(itemRow.Id.ToString());
            }

            iconImage.enabled        = true;
            iconImage.overrideSprite = itemSprite;
            iconImage.SetNativeSize();
        }
Пример #5
0
 public void Initialize(Static.Item staticItem)
 {
     StaticItem   = staticItem;
     _icon.sprite = SpriteHelper.GetItemIcon(staticItem);
 }
Пример #6
0
 public static Sprite GetIconSprite(this ItemBase item)
 {
     return(SpriteHelper.GetItemIcon(item.Id));
 }
Пример #7
0
 public void Initialize(Dto.Item item)
 {
     Item         = item;
     _icon.sprite = SpriteHelper.GetItemIcon(item.StaticItem);
     _text.text   = Item.Amount.ToString();
 }