48 lines
927 B
C#
48 lines
927 B
C#
using Sirenix.OdinInspector;
|
|
using System.Collections;
|
|
using System.Collections.Generic;
|
|
using TMPro;
|
|
using UnityEngine;
|
|
using UnityEngine.Events;
|
|
using UnityEngine.UI;
|
|
|
|
public class LevelItemUI : MonoBehaviour
|
|
{
|
|
[ReadOnly]
|
|
[SerializeField]
|
|
private Level level;
|
|
|
|
[ReadOnly]
|
|
[SerializeField]
|
|
private bool isLocked;
|
|
|
|
[SerializeField]
|
|
private TextMeshProUGUI difficultyText;
|
|
|
|
[SerializeField]
|
|
private TextMeshProUGUI nameText;
|
|
|
|
[SerializeField]
|
|
private TextMeshProUGUI descriptionText;
|
|
|
|
[SerializeField]
|
|
private Image backgroundImage;
|
|
|
|
public UnityEvent<Level> OnClicked;
|
|
|
|
public void Setup(Level level, bool isLocked)
|
|
{
|
|
this.level = level;
|
|
this.isLocked = isLocked;
|
|
|
|
nameText.text = level.levelName;
|
|
difficultyText.text = "0";
|
|
}
|
|
|
|
[Button]
|
|
public void OnButtonClicked()
|
|
{
|
|
OnClicked?.Invoke(level);
|
|
}
|
|
}
|