You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
69 lines
1.5 KiB
69 lines
1.5 KiB
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<Toggle>();
|
|
txtName = transform.Find("txtAbility").GetComponent<TextMeshProUGUI>();
|
|
}
|
|
|
|
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);
|
|
}
|
|
}
|