WXMC/proj/unity/Assets/Scripts/Wish/PuzzleDrawTarotItem.cs
2024-12-04 16:18:46 +08:00

28 lines
756 B
C#

using System;
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
using UnityEngine.UI;
public class PuzzleDrawTarotItem : MonoBehaviour
{
[SerializeField]
private Text Text_DrawTarotName;
[SerializeField]
private Button Btn_SelectBtn;
private PuzzleDrawTarot currPuzzleDrawTarot;
private Action<PuzzleDrawTarot> selectAc;
public void Init(PuzzleDrawTarot PuzzleDrawTarot,Action<PuzzleDrawTarot> selectAction)
{
selectAc = selectAction;
currPuzzleDrawTarot = PuzzleDrawTarot;
Text_DrawTarotName.text = currPuzzleDrawTarot.DisplayName;
Btn_SelectBtn.onClick.AddListener(SelectItem);
}
void SelectItem()
{
selectAc(currPuzzleDrawTarot);
}
}