|
|
|
|
|
|
[SerializeField] private Button _itemButton = default; |
|
|
|
[SerializeField] private Image _bgInactiveImage = default; |
|
|
|
|
|
|
|
bool _isSelected = false; |
|
|
|
public UnityAction<ItemSO> ItemSelected; |
|
|
|
|
|
|
|
[SerializeField] private LocalizeSpriteEvent _bgLocalizedImage = default; |
|
|
|
|
|
|
_isSelected = isSelected; |
|
|
|
_itemPreviewImage.gameObject.SetActive(true); |
|
|
|
_itemCount.gameObject.SetActive(true); |
|
|
|
_bgImage.gameObject.SetActive(true); |
|
|
|
|
|
|
|
|
|
|
public void SelectFirstElement() |
|
|
|
{ |
|
|
|
_isSelected = true; |
|
|
|
|
|
|
|
private void OnEnable() |
|
|
|
{ |
|
|
|
if (_isSelected) |
|
|
|
{ SelectItem(); } |
|
|
|
} |
|
|
|
public void HoverItem() |
|
|
|
{ |
|
|
|
_imgHover.gameObject.SetActive(true); |
|
|
|
|
|
|
|
|
|
|
public void SelectItem() |
|
|
|
{ |
|
|
|
_isSelected = true; |
|
|
|
if (ItemSelected != null && _currentItem != null && _currentItem.Item != null) |
|
|
|
|
|
|
|
{ |
|
|
|
|
|
|
|
|
|
|
public void UnselectItem() |
|
|
|
{ |
|
|
|
_isSelected = false; |
|
|
|
_imgSelected.gameObject.SetActive(false); |
|
|
|
|
|
|
|
} |
|
|
|