using TMPro; using UnityEngine; using UnityEngine.UI; public class EScrAbilityAutoReroll : EScrCell { private Toggle tglSelect; private TextMeshProUGUI txtName; public override void InitCell() { tglSelect = transform.Find("CheckBox").GetComponent(); txtName = transform.Find("txtAbility").GetComponent(); } public override void RefreshCellView() { SetData(itemID); } public override void SetData(int itemid) { itemID = itemid; txtName.text = FormatString.TextEffectTitle(EnhanceMgr.SGetEfcAddAutoType(itemid)); SetSelected(EnhanceMgr.Instance.SGetEfcAddAutoSelect(itemid)); } public void OffTextColor() { txtName.color = new Color(1f, 1f, 1f); } public void isOnFalse() { tglSelect.SetIsOnWithoutNotify(false); } public void SetText(string strtext) { txtName.text = strtext; } public bool IsSelected() { return tglSelect.isOn; } public void SetSelected(bool bselect) { if (bselect) txtName.color = Global.CLR_TextYellow; else txtName.color = Global.CLR_White; tglSelect.SetIsOnWithoutNotify(bselect); } public void SetToggle() { tglSelect.isOn = true; } public void ToggleSelect(bool bselect) { SoundMgr.Instance.PlaySfx(SoundName.BtnPress); EnhanceMgr.SToggleSelect(itemID, bselect); } }