[TASK] Show collected duck stickers
This commit is contained in:
37
Assets/StickerDisplay.cs
Normal file
37
Assets/StickerDisplay.cs
Normal file
@@ -0,0 +1,37 @@
|
||||
using System.Collections;
|
||||
using System.Collections.Generic;
|
||||
using TMPro;
|
||||
using UnityEngine;
|
||||
using UnityEngine.EventSystems;
|
||||
using UnityEngine.UI;
|
||||
|
||||
public class StickerDisplay : MonoBehaviour
|
||||
{
|
||||
public TMP_Text label;
|
||||
public TMP_Text duckCount;
|
||||
public Image stickerImage;
|
||||
|
||||
private DuckStickerData _sticker;
|
||||
public DuckStickerData Sticker
|
||||
{
|
||||
get { return _sticker; }
|
||||
set
|
||||
{
|
||||
_sticker = value;
|
||||
label.text = _sticker.Label;
|
||||
stickerImage.sprite = _sticker.StickerSprite;
|
||||
}
|
||||
}
|
||||
|
||||
private int _collectedCount;
|
||||
|
||||
public int CollectedCount
|
||||
{
|
||||
get => _collectedCount;
|
||||
set
|
||||
{
|
||||
_collectedCount = value;
|
||||
duckCount.text = _collectedCount + "x";
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user