using TMPro; using UnityEngine; using UnityEngine.UI; using IVDataFormat; public class EScrAbilityAutoReroll : EScrCell { private Toggle tglSelect; private TextMeshProUGUI txtCheck; private TextMeshProUGUI txtName; eRarity rarity; public override void InitCell() { tglSelect = transform.Find("CheckBox").GetComponent(); txtCheck = tglSelect.transform.Find("CheckV").GetComponent(); txtName = transform.Find("txtAbility").GetComponent(); } public override void RefreshCellView() { base.RefreshCellView(); SetData(itemID); } public override void SetData(int itemid) { itemID = itemid; txtName.text = FormatString.TextEffectTitle(EnhanceMgr.SGetEfcAddAutoType(itemid)); SetSelected(EnhanceMgr.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) { txtCheck.enabled = 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.PlaySfx(SoundName.BtnPress); EnhanceMgr.SToggleSelect(itemID, bselect); } }