using UnityEngine; using TMPro; using UnityEngine.UI; public class RareityAutoReroll : MonoBehaviour { [SerializeField] IVDataFormat.eRarity rareity; TextMeshProUGUI txtName; Toggle checkBox; public void Init() { txtName = transform.Find("txtAbility").GetComponent(); checkBox = transform.Find("CheckBox").GetComponent(); CheckTextColor(); } public void Localize() { if (rareity == IVDataFormat.eRarity.Legend) { txtName.text = LocalizationText.GetText("awaken_grade_hero_up"); } else if (rareity == IVDataFormat.eRarity.Mystic) { txtName.text = LocalizationText.GetText("awaken_grade_mystic"); } } public void CheckBoxClick() { EnhanceMgr.SetAutoRareity(rareity); CheckTextColor(); } public void CheckTextColor() { if (checkBox.isOn) { txtName.color = Global.CLR_TextYellow; } else { txtName.color = new Color(1f, 1f, 1f); } } }