You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
29 lines
511 B
29 lines
511 B
using System; |
|
using TMPro; |
|
using UnityEngine; |
|
using UnityEngine.UI; |
|
|
|
namespace Dialogs |
|
{ |
|
public class SlotMachineItem : MonoBehaviour |
|
{ |
|
[SerializeField] private Image _icon; |
|
[SerializeField] private TextMeshProUGUI _text; |
|
|
|
private event Action _click; |
|
|
|
public void SetData(Sprite sprite, string text, Action click) |
|
{ |
|
if (sprite != null) |
|
_icon.sprite = sprite; |
|
_text.text = string.Empty; |
|
_click += click; |
|
} |
|
|
|
public void Collect() |
|
{ |
|
if (_click != null) |
|
_click(); |
|
} |
|
} |
|
}
|
|
|