public void SetByArmorId(int armorId) { var image = SpriteHelper.GetItemIcon(armorId); if (image is null) { throw new FailedToLoadResourceException <Sprite>(armorId.ToString()); } SetIcon(image); }
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(); }
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(); }
public void Initialize(Static.Item staticItem) { StaticItem = staticItem; _icon.sprite = SpriteHelper.GetItemIcon(staticItem); }
public static Sprite GetIconSprite(this ItemBase item) { return(SpriteHelper.GetItemIcon(item.Id)); }
public void Initialize(Dto.Item item) { Item = item; _icon.sprite = SpriteHelper.GetItemIcon(item.StaticItem); _text.text = Item.Amount.ToString(); }