using System.Collections;
using System.Collections.Generic;
using UnityEngine;
using UnityEngine.Events;
using UnityEngine.UI;
///
/// 步骤按钮控制类
///
public class StepButtonCtrl : MonoBehaviour
{
public TextButtonCtrl thisButtonText;
public Button button_this;
UnityAction thisButtonClick;
StepType currentType;
public StepType Type
{
get
{
return currentType;
}
set
{
currentType = value;
}
}
// Start is called before the first frame update
void Start()
{
button_this.onClick.AddListener(ButtonClick);
}
void ButtonClick()
{
thisButtonClick?.Invoke(this);
}
//注入初始化数据
public void InjectInitData(string str, UnityAction clickEvent,StepType stepType)
{
thisButtonText.SetStr(str);
thisButtonClick = clickEvent;
currentType = stepType;
}
}