| | |
| | | public class WashTips : MonoBehaviour
|
| | | {
|
| | | #region 成员变量
|
| | | private Text _costMoneyText;
|
| | | private Text _washLevelTitle;
|
| | | private Button _washBtn;
|
| | | private Button _saveBtn;
|
| | | private Button _cancelBtn;
|
| | | private Button _upgradeBtn;
|
| | | private Button _washMasterBtn;
|
| | | private Text _specWashOpenCondition;
|
| | | private Text _specWashFullText;
|
| | | private GameObject _openSpecWashPro;
|
| | | private ScrollRect _selectWashRect;
|
| | | private ScrollerController _equipWashCtrl;
|
| | | private Text _washFullLvText;
|
| | | private ItemCell _costMatCell;
|
| | | private ItemCell _washEquipCell;
|
| | | private WashPro _attackWashPro; //攻击洗练属性
|
| | | private WashPro _lifeWashPro; //生命
|
| | | private WashPro _ignoreDefenceWashPro; //无视防御
|
| | | private ToggleGroup _cellGroup;
|
| | | private GameObject noEquipObj;
|
| | | [SerializeField]
|
| | | [SerializeField] Text _costMoneyText;
|
| | | [SerializeField] Text _washLevelTitle;
|
| | | [SerializeField] Button _washBtn;
|
| | | [SerializeField] Button _saveBtn;
|
| | | [SerializeField] Button _cancelBtn;
|
| | | [SerializeField] Button _upgradeBtn;
|
| | | [SerializeField] Button _washMasterBtn;
|
| | | [SerializeField] Text _specWashOpenCondition;
|
| | | [SerializeField] Text _specWashFullText;
|
| | | [SerializeField] GameObject _openSpecWashPro;
|
| | | [SerializeField] ScrollRect _selectWashRect;
|
| | | [SerializeField] ScrollerController _equipWashCtrl;
|
| | | [SerializeField] Text _washFullLvText;
|
| | | [SerializeField] ItemCell _costMatCell;
|
| | | [SerializeField] ItemCell _washEquipCell;
|
| | | [SerializeField] WashPro _attackWashPro; //攻击洗练属性
|
| | | [SerializeField] WashPro _lifeWashPro; //生命
|
| | | [SerializeField] WashPro _ignoreDefenceWashPro; //无视防御
|
| | | [SerializeField] ToggleGroup _cellGroup;
|
| | | [SerializeField] GameObject noEquipObj;
|
| | | [SerializeField] GameObject contain_Cost;
|
| | | [SerializeField] ItemCell contain_Cost_NormalItem;
|
| | | [SerializeField] ItemCell contain_Cost_MustAddItem;
|
| | | [SerializeField] Text contain_Cost_Money;
|
| | | [SerializeField] GameObject contain_Default;
|
| | |
|
| | | List<Text> specAttrNameText = new List<Text>();
|
| | | [SerializeField]
|
| | | List<Text> specAttrValueText = new List<Text>();
|
| | |
| | |
|
| | | private void Awake()
|
| | | {
|
| | |
|
| | | _washEquipCell = transform.Find("EquipInfoBG/WashItemBottom/ItemCell").GetComponent<ItemCell>();
|
| | | noEquipObj = transform.Find("EquipInfoBG/WashItemBottom/NoEquip").gameObject;
|
| | | _costMatCell = transform.Find("CostItem/ItemCell").GetComponent<ItemCell>();
|
| | | _washFullLvText = transform.Find("FullLvText").GetComponent<Text>();
|
| | | _selectWashRect = transform.Find("SelectList").GetComponent<ScrollRect>();
|
| | | _washBtn = transform.Find("WashBtn").GetComponent<Button>();
|
| | | _saveBtn = transform.Find("SaveBtn").GetComponent<Button>();
|
| | | _cancelBtn = transform.Find("CancelBtn").GetComponent<Button>();
|
| | | _upgradeBtn = transform.Find("UpgrdeBtn").GetComponent<Button>();
|
| | | _washMasterBtn = transform.Find("WashMasterBtn").GetComponent<Button>();
|
| | | _attackWashPro = transform.Find("AttributeInfo/Attribute01").GetComponent<WashPro>();
|
| | | _lifeWashPro = transform.Find("AttributeInfo/Attribute02").GetComponent<WashPro>();
|
| | |
|
| | | _ignoreDefenceWashPro = transform.Find("AttributeInfo/Attribute03").GetComponent<WashPro>();
|
| | | _washLevelTitle = transform.Find("AttributeInfo/TitleBG/TitleText").GetComponent<Text>();
|
| | | _costMoneyText = transform.Find("CostItem/Money/MoneyCountText").GetComponent<Text>();
|
| | | _specWashOpenCondition = transform.Find("AttributeInfo/WashMaster/SpecWashOpenCondition").GetComponent<Text>();
|
| | | _specWashFullText = transform.Find("AttributeInfo/WashMasterFull").GetComponent<Text>();
|
| | | _specWashOpenCondition.gameObject.SetActive(true);
|
| | | _specWashFullText.gameObject.SetActive(false);
|
| | | _openSpecWashPro = transform.Find("AttributeInfo/WashMaster/SpecWashPro").gameObject;
|
| | | _equipWashCtrl = transform.Find("EquipWashCtrl").GetComponent<ScrollerController>();
|
| | | _cellGroup = _equipWashCtrl.GetComponent<ToggleGroup>();
|
| | | _equipWashCtrl.OnRefreshCell += RefreshEquipWashCell;
|
| | | EquipReinforceEventMgr.Instance.RefreshWashCostMoneyEvent = RefreshCostMoney;
|
| | | _openSpecWashPro.SetActive(false);
|
| | |
| | |
|
| | | }
|
| | |
|
| | | public void UpdateWashMat()
|
| | | {
|
| | | bool isMustAdd = GetMustAddNum() > 0 ? true : false;
|
| | | contain_Cost.SetActive(isMustAdd);
|
| | | contain_Default.SetActive(!isMustAdd);
|
| | | if (!isMustAdd)
|
| | | {
|
| | | UpdateItemCell(_tagWashModel.costItem,_costMatCell,_tagWashModel.costCount);
|
| | | }
|
| | | else
|
| | | {
|
| | | UpdateItemCell(_tagWashModel.costItem, contain_Cost_NormalItem, _tagWashModel.costCount);
|
| | | }
|
| | | }
|
| | |
|
| | | private void UpdateItemCell(int itemId,ItemCell itemCell,int needNum)
|
| | | {
|
| | | ItemCellModel cellModel = new ItemCellModel(itemId);
|
| | | itemCell.Init(cellModel);
|
| | | itemCell.countText.gameObject.SetActive(true);
|
| | | int haveNum = playerPack.GetItemCountByID(PackType.rptItem,itemId);
|
| | | string matNumStr = string.Empty;
|
| | | if (haveNum >= needNum)
|
| | | {
|
| | | matNumStr = UIHelper.AppendStringColor(TextColType.Green,haveNum.ToString(), true);
|
| | | }
|
| | | else
|
| | | {
|
| | | matNumStr = UIHelper.AppendStringColor(TextColType.Red,haveNum.ToString());
|
| | | }
|
| | | itemCell.countText.text = StringUtility.Contact(matNumStr, "/",needNum);
|
| | | itemCell.cellBtn.RemoveAllListeners();
|
| | | itemCell.cellBtn.onClick.AddListener(() =>
|
| | | {
|
| | | itemPathModel.SetChinItemModel(itemId);
|
| | | });
|
| | | }
|
| | |
|
| | | public int GetMustAddNum()
|
| | | {
|
| | | int needAddCount = 0;
|
| | | if (_attackWashPro.toggleIsOn)
|
| | | {
|
| | | needAddCount += 1;
|
| | | }
|
| | | |
| | | if (_lifeWashPro.toggleIsOn)
|
| | | {
|
| | | needAddCount += 1;
|
| | | }
|
| | |
|
| | | if (_ignoreDefenceWashPro.toggleIsOn)
|
| | | {
|
| | | needAddCount += 1;
|
| | | }
|
| | | return needAddCount;
|
| | | }
|
| | |
|
| | | //刷新仙玉
|
| | | public void RefreshCostMoney()
|
| | | {
|