少年修仙传客户端代码仓库
client_linchunjie
2018-09-06 619a37b0c8c78845a034d1e36a5d77654f88a23e
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
using System;
using System.Collections.Generic;
using UnityEngine.UI;
using UnityEngine;
using TableConfig;
using System.Linq;
using Snxxz.UI;
using System.Collections;
 
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]
    List<Text> specAttrNameText = new List<Text>();
    [SerializeField]
    List<Text> specAttrValueText = new List<Text>();
 
    [SerializeField]
    UIEffect washEffect;
    [SerializeField] float offest = 50;
 
    #endregion
 
    private WashProCount _washProModel;
    private EquipWashConfig _tagWashModel;
    private ItemModel _itemModel; //洗练的装备
    private List<string> _costMoneylist = null;
    private int _costmoney = 0;
    public int CostMoney
    {
        get { return _costmoney; }
        set { _costmoney = value; }
    }
    private List<WashProCount> _washInfolist;
    private int curWashEquip = 0;
 
    EquipWashModel _equipWashModel;
    EquipWashModel equipWashModel
    {
        get
        {
            return _equipWashModel ?? (_equipWashModel = ModelCenter.Instance.GetModel<EquipWashModel>());
        }
    }
 
    WashProModel _washAttrModel;
    WashProModel washAttrModel
    {
        get
        {
            return _washAttrModel ?? (_washAttrModel = ModelCenter.Instance.GetModel<WashProModel>());
        }
    }
 
    HowToPlayModel _toPlayModel;
    HowToPlayModel toPlayModel
    {
        get { return _toPlayModel ?? (_toPlayModel = ModelCenter.Instance.GetModel<HowToPlayModel>()); }
    }
 
    GetItemPathModel _itemPathModel;
    GetItemPathModel itemPathModel
    {
        get { return _itemPathModel ?? (_itemPathModel = ModelCenter.Instance.GetModel<GetItemPathModel>()); }
    }
 
    ItemTipsModel _itemTipsModel;
    ItemTipsModel itemTipsModel
    {
        get
        {
            return _itemTipsModel ?? (_itemTipsModel = ModelCenter.Instance.GetModel<ItemTipsModel>());
        }
    }
 
    PlayerPackModel _playerPack;
    PlayerPackModel playerPack
    {
        get { return _playerPack ?? (_playerPack = ModelCenter.Instance.GetModel<PlayerPackModel>()); }
    }
 
    public int jumpToWashId = 0;
    AchievementGuideEffect guideEffect = null;
 
    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);
 
    }
 
    private void OnEnable()
    {    
        jumpToWashId = 0;
        guideEffect = null;
        //_equipWashCtrl.mScrollRect.verticalNormalizedPosition = 1;
        #region 初始化监听和数据
        curWashEquip = 0;
        isOpenPrompting = true;
        _attackWashPro.toggleIsOn = false;
        _lifeWashPro.toggleIsOn = false;
        _ignoreDefenceWashPro.toggleIsOn = false;
 
        _equipWashCtrl.lockType = EnhanceLockType.KeepVertical;
        _cancelBtn.onClick.AddListener(OnClickCancelBtn);
        _upgradeBtn.onClick.AddListener(OnClickUpGradeBtn);
        _washMasterBtn.onClick.AddListener(OnClickMasterBtn);
        equipWashModel.RefreshWashModelEvent += RefreshModel;
        playerPack.RefreshItemCountAct += RefreshCostItem;
        #endregion
        CreateEquipWashCell();
        CheckJumpToModel();
    }
    private void OnDisable()
    {
        _washBtn.onClick.RemoveAllListeners();
        _saveBtn.onClick.RemoveAllListeners();
        _cancelBtn.onClick.RemoveAllListeners();
        _upgradeBtn.onClick.RemoveAllListeners();
        _washMasterBtn.onClick.RemoveAllListeners();
        equipWashModel.RefreshWashModelEvent -= RefreshModel;
        playerPack.RefreshItemCountAct -= RefreshCostItem;
    }
 
    private void CheckJumpToModel()
    {
        _attackWashPro.isShowPerfectEffect = false;
        _lifeWashPro.isShowPerfectEffect = false;
        _ignoreDefenceWashPro.isShowPerfectEffect = false;
 
        if (AchievementGoto.guideAchievementId != 0)
        {
            SuccessConfig successConfig = Config.Instance.Get<SuccessConfig>(AchievementGoto.guideAchievementId);
            if(successConfig.Type == 66)
            {
                bool isWash = false;
                for(int i = 0; i < _washInfolist.Count; i++)
                {
                    WashProCount washPro = _washInfolist[i];
                    ItemModel itemModel = playerPack.GetItemModelByIndex(PackType.rptEquip,washPro.EquipPlace);
                    if(itemModel != null)
                    {
                        EquipWashConfig washModel = EquipWashConfig.GetCurrentWashEquipModel(equipWashModel.OnGetWashType(washPro.EquipPlace), washPro.XLAttrLV);
                        if (equipWashModel.IsEnoughMat(washModel) && equipWashModel.IsCanWash(itemModel))
                        {
                            jumpToWashId = washPro.EquipPlace;
                            isWash = true;
                            curWashEquip = i;
                            _equipWashCtrl.JumpIndex(curWashEquip);
                            _equipWashCtrl.m_Scorller.RefreshActiveCellViews();
                            break;
                        }
                    }
                }
 
                if(!isWash)
                {
                    MessageWin.Inst.ShowFixedTip(Language.Get("Material101"));
                }
                else
                {
                    guideEffect = AchievementGuideEffectPool.Require(1);
                    guideEffect.transform.SetParentEx(_washBtn.transform,Vector3.zero,Quaternion.identity,Vector3.one);
                }
                AchievementGoto.guideAchievementId = 0;
            }
        }
        else
        {
            curWashEquip = equipWashModel.JumpToIndex;
            _equipWashCtrl.JumpIndex(curWashEquip);
            _equipWashCtrl.m_Scorller.RefreshActiveCellViews();
        }
 
        OnClickWashCellToggle(_washInfolist[curWashEquip],curWashEquip);
        StartCoroutine(SetOffestPos());
    }
 
    private IEnumerator SetOffestPos()
    {
        yield return null;
        if (curWashEquip != 0)
        {
            _equipWashCtrl.JumpIndex(-offest, 0, EnhancedUI.EnhancedScroller.EnhancedScroller.TweenType.immediate);
        }
    }
 
    private void CreateEquipWashCell()
    {
        _washInfolist = equipWashModel.GetWashModellist();
        int i = 0;
        _equipWashCtrl.Refresh();
        for (i = 0; i < _washInfolist.Count; i++)
        {
            _equipWashCtrl.AddCell(ScrollerDataType.Header, i);
        }
        _equipWashCtrl.Restart();
    }
 
    public void RefreshModel()
    {
        CreateEquipWashCell();
        OnClickWashCellToggle(_washInfolist[curWashEquip], curWashEquip);
    }
 
 
    private void RefreshEquipWashCell(ScrollerDataType type, CellView cell)
    {
        EquipWashCell equipWashCell = cell.GetComponent<EquipWashCell>();
        if(equipWashCell != null)
        {
            WashProCount washPro = _washInfolist[cell.index];
            equipWashCell.SetDisplayModel(washPro, equipWashModel.washEquipRedPointlist[cell.index].id,cell.index,curWashEquip);
            equipWashCell.cellToggle.RemoveAllListeners();
            equipWashCell.cellToggle.AddListener(()=>
            {
                OnClickWashCellToggle(washPro,cell.index);
            });
        }
    }
 
 
    private void OnClickWashCellToggle(WashProCount washPro,int index)
    {
        if (curWashEquip != index)
        {
            _attackWashPro.isShowPerfectEffect = false;
            _lifeWashPro.isShowPerfectEffect = false;
            _ignoreDefenceWashPro.isShowPerfectEffect = false;
 
            _attackWashPro.toggleIsOn = false;
            _lifeWashPro.toggleIsOn = false;
            _ignoreDefenceWashPro.toggleIsOn = false;
            if (washPro.EquipPlace != jumpToWashId)
            {
                if (guideEffect != null)
                {
                    AchievementGuideEffectPool.Recycle(guideEffect);
                    guideEffect = null;
                }
            }
        }
        ItemModel itemModel = playerPack.GetItemModelByIndex(PackType.rptEquip, washPro.EquipPlace);
        EquipWashConfig washModel = EquipWashConfig.GetCurrentWashEquipModel(equipWashModel.OnGetWashType(washPro.EquipPlace), washPro.XLAttrLV);
        _washProModel = washPro;
        _tagWashModel = washModel;
        _costMoneylist = GetToolsList(_tagWashModel.costMoneyList, _costMoneylist);
        washAttrModel.SetUIModel(washModel, washPro, WashAttrType.attack);
        washAttrModel.SetUIModel(washModel, washPro, WashAttrType.life);
        washAttrModel.SetUIModel(washModel, washPro, WashAttrType.ignoredefence);
        _attackWashPro.RefreshUI(WashAttrType.attack);
        _lifeWashPro.RefreshUI(WashAttrType.life);
        _ignoreDefenceWashPro.RefreshUI(WashAttrType.ignoredefence);
 
        if (washPro.isPutOn == false)
        {
            _washLevelTitle.text = Language.Get("EquipWash108", 0);
        }
        else
        {
            _washLevelTitle.text = Language.Get("EquipWash108", washPro.XLAttrLV);
        }
        _costMatCell.gameObject.SetActive(true);
        ItemCellModel cellModel = new ItemCellModel(washModel.costItem);
        _costMatCell.Init(cellModel);
        _costMatCell.cellBtn.RemoveAllListeners();
        _costMatCell.cellBtn.onClick.AddListener(() =>
        {
            itemPathModel.SetChinItemModel(washModel.costItem);
        });
 
        #region 刷新物品UI
        if (itemModel == null)
        {
            _washEquipCell.gameObject.SetActive(false);
            noEquipObj.SetActive(true);
        }
        else
        {
            noEquipObj.SetActive(false);
            RefreshCostItem(itemModel.packType, itemModel.itemInfo.ItemPlace, itemModel.itemInfo.ItemID);
            _itemModel = itemModel;
            _washEquipCell.gameObject.SetActive(true);
            _washEquipCell.Init(itemModel);
            _washEquipCell.cellBtn.RemoveAllListeners();
            _washEquipCell.cellBtn.onClick.AddListener(() =>
            {
                itemTipsModel.SetItemTipsModel(PackType.rptEquip, itemModel.itemInfo.ItemGUID);
            });
 
            RefreshCostMoney();
        }
 
        #endregion
 
        RefreshSpecWashUI();
 
        ChangeBtn();
        curWashEquip = index;
        equipWashModel.washBtnRedpoint.state = equipWashModel.washEquipRedPointlist[index].state;
        _equipWashCtrl.m_Scorller.RefreshActiveCellViews();
    }
    //刷新材料
    public void RefreshCostItem(PackType type, int index, int id)
    {
        SinglePackModel singlePack = playerPack.GetSinglePackModel(PackType.rptItem);
        if (singlePack == null)
            return;
 
        _costMatCell.countText.gameObject.SetActive(true);
        int bagItemCount = singlePack.GetItemCountByID(_tagWashModel.costItem);
        if (bagItemCount >= _tagWashModel.costCount)
            _costMatCell.countText.text = UIHelper.GetTextColorByItemColor(TextColType.Green, bagItemCount.ToString(),true) + "/" + _tagWashModel.costCount;
        else
            _costMatCell.countText.text = UIHelper.GetTextColorByItemColor(TextColType.Red, bagItemCount.ToString()) + "/" + _tagWashModel.costCount;
 
    }
 
    //刷新仙玉
    public void RefreshCostMoney()
    {
        int needAddCount = 0;
        if (_attackWashPro.toggleIsOn)
            needAddCount += 1;
 
        if (_lifeWashPro.toggleIsOn)
            needAddCount += 1;
 
        if (_ignoreDefenceWashPro.toggleIsOn)
            needAddCount += 1;
 
        if (needAddCount == 0)
        {
            CostMoney = 0;
        }
        else if (needAddCount == 1)
        {
            CostMoney = int.Parse(GetCostMoneyList()[0]);
        }
        else if (needAddCount == 2)
        {
            CostMoney = int.Parse(GetCostMoneyList()[1]);
        }
        else if (needAddCount == 3)
        {
            CostMoney = int.Parse(GetCostMoneyList()[2]);
        }
 
        int goldCount = (int)PlayerDatas.Instance.baseData.Gold;
        if (goldCount >= CostMoney)
        {
            _costMoneyText.text = StringUtility.Contact("<color=#109D06>", CostMoney.ToString(), "</color>");
        }
        else
        {
            _costMoneyText.text = StringUtility.Contact("<color=#ff0000>", CostMoney.ToString(), "</color>");
        }
 
    }
 
 
    //刷新特殊洗练UI
    public void RefreshSpecWashUI()
    {
        equipWashModel.OnGetMasterModel(_washInfolist);
        int type = equipWashModel.OnGetWashType(_washProModel.EquipPlace);
        int curTypeLv = 0;
        switch (type)
        {
            case 1:
                curTypeLv = equipWashModel.washGroup1[0].XLAttrLV;
                _specWashOpenCondition.text = Language.Get("WashTips_SpecWashOpenCondition_1");
                _specWashFullText.text = Language.Get("WashTips_SpecWashFull_1");
                break;
            case 2:
                curTypeLv = equipWashModel.washGroup2[0].XLAttrLV;
                _specWashOpenCondition.text = Language.Get("WashTips_SpecWashOpenCondition_2");
                _specWashFullText.text = Language.Get("WashTips_SpecWashFull_2");
                break;
            case 3:
                curTypeLv = equipWashModel.washGroup3[0].XLAttrLV;
                _specWashOpenCondition.text = Language.Get("WashTips_SpecWashOpenCondition_3");
                _specWashFullText.text = Language.Get("WashTips_SpecWashFull_3");
                break;
        }
 
        List<EquipWashSpecConfig> tagSpecModellist = EquipWashSpecConfig.GetWashSpecModel(type);
        if (curTypeLv < tagSpecModellist[0].levelNeed)
        {
            _specWashOpenCondition.gameObject.SetActive(true);
            _openSpecWashPro.SetActive(false);
        }
        else
        {
            _specWashOpenCondition.gameObject.SetActive(false);
            _openSpecWashPro.SetActive(true);
            int i = 0;
            for (i = tagSpecModellist.Count - 1; i > -1; i--)
            {
                if (curTypeLv >= tagSpecModellist[i].levelNeed)
                {
                    int[] specAttrsID = ConfigParse.GetMultipleStr<int>(tagSpecModellist[i].attByLevel);
                    int[] specAttrsValue = ConfigParse.GetMultipleStr<int>(tagSpecModellist[i].attByLevelValue);
                    int j = 0;
                    for (j = 0; j < specAttrNameText.Count; j++)
                    {
                        if(j < specAttrsID.Length)
                        {
                            specAttrNameText[j].gameObject.SetActive(true);
                            specAttrValueText[j].gameObject.SetActive(true);
                            PlayerPropertyConfig propertyModel = Config.Instance.Get<PlayerPropertyConfig>(specAttrsID[j]);
                            specAttrNameText[j].text = propertyModel.Name;
                            specAttrValueText[j].text = equipWashModel.GetProValueTypeStr(propertyModel, specAttrsValue[j]);
                        }
                        else
                        {
                            specAttrNameText[j].gameObject.SetActive(false);
                            specAttrValueText[j].gameObject.SetActive(false);
                        }
                      
                    }
                    break;
                }
            }
        }
 
        if(curTypeLv >= tagSpecModellist[tagSpecModellist.Count - 1].levelNeed)
        {
            _specWashFullText.gameObject.SetActive(true);
        }
        else
        {
            _specWashFullText.gameObject.SetActive(false);
        }
    }
 
    public void ChangeBtn()
    {
        _washBtn.onClick.RemoveAllListeners();
        if (_washProModel.isPutOn)
        {
            if (equipWashModel.IsCanWash(_itemModel))
            {
                if (equipWashModel.IsSaveWashValue(_washProModel))
                {
                    if (equipWashModel.IsWashFull(_itemModel, _washProModel, _tagWashModel))
                    {
                        _washFullLvText.text = Language.Get("EquipWash113", _itemModel.chinItemModel.LV, equipWashModel.GetWashFullLv(_itemModel.chinItemModel.LV));
                        ObjHideOrShow(false, false, false, false, true);
                    }
                    else
                    {
                        if (_attackWashPro.singleWashAttrModel.isPerfect && _lifeWashPro.singleWashAttrModel.isPerfect
                            && _ignoreDefenceWashPro.singleWashAttrModel.isPerfect)
                        {
                            ObjHideOrShow(false, false, false, true, false);
                        }
                        else
                        {
 
                            if (_attackWashPro.singleWashAttrModel.washState == WashState.None && _lifeWashPro.singleWashAttrModel.washState == WashState.None
                                && _ignoreDefenceWashPro.singleWashAttrModel.washState == WashState.None)
                            {
                                _washBtn.onClick.AddListener(OnClickWashBtn);
                                ObjHideOrShow(true, false, false, false, false);
                            }
                            else
                            {
                                ObjHideOrShow(false, false, true, false, false);
                                _saveBtn.RemoveAllListeners();
                                _saveBtn.onClick.AddListener(() => { OnClickSaveBtn(); });
                            }
                        }
 
                    }
                }
                else
                {
                    ObjHideOrShow(false, true, true, false, false);
                    _saveBtn.RemoveAllListeners();
                    _saveBtn.onClick.AddListener(() => { OnClickSaveBtn(); });
                }
            }
            else
            {
                _washFullLvText.text = Language.Get("EquipWash114", equipWashModel.WashMinLV());
                ObjHideOrShow(false, false, false, false, true);
 
            }
        }
        else
        {
            _washBtn.onClick.AddListener(OnClickWashBtn);
            ObjHideOrShow(true, false, false, false, false);
            //_washBtn.GetComponent<Image>().SetSprite("BlackBtn");
        }
 
    }
 
    private void ObjHideOrShow(params bool[] isShows)
    {
        _washBtn.gameObject.SetActive(isShows[0]);
        _cancelBtn.gameObject.SetActive(isShows[1]);
        _saveBtn.gameObject.SetActive(isShows[2]);
        _upgradeBtn.gameObject.SetActive(isShows[3]);
        _washFullLvText.gameObject.SetActive(isShows[4]);
    }
 
    #region 按钮事件
 
    private bool isOpenPrompting = true;
 
    private void OnClickWashBtn()
    {
        if (_washProModel.isPutOn)
        {
        
            int goldCount = (int)PlayerDatas.Instance.baseData.Gold;
            if (equipWashModel.IsEnoughMat(_tagWashModel))
            {
                if (CostMoney > 0)
                {
                    if (goldCount >= CostMoney)
                    {
                        if (isOpenPrompting)
                        {
                            ConfirmCancel.ToggleConfirmCancel(Language.Get("Mail101"), Language.Get("EquipWash103", CostMoney),
                            Language.Get("ConfirmCancel101"), (bool isOk, bool isToggle) =>
                            {
                                if (isOk)
                                {
                                    washEffect.Play();
                                    equipWashModel.SendWashQuest(_washProModel.EquipPlace, GetWashCheckUseGoldAttr());
                                }
 
                                isOpenPrompting = !isToggle;
                            });
                        }
                        else
                        {
                            washEffect.Play();
                            equipWashModel.SendWashQuest(_washProModel.EquipPlace, GetWashCheckUseGoldAttr());
                        }
 
                    }
                    else
                    {
                        if (VersionConfig.Get().isBanShu)
                        {
                            SysNotifyMgr.Instance.ShowTip("GoldErr");
                            return;
                        }
                        WindowCenter.Instance.Open<RechargeTipWin>();
                    }
                }
                else
                {
                    washEffect.Play();
                    equipWashModel.SendWashQuest(_washProModel.EquipPlace, GetWashCheckUseGoldAttr());
                }
            }
            else
            {
                itemPathModel.SetChinItemModel(_tagWashModel.costItem);
            }
        }
        else
        {
            SysNotifyMgr.Instance.ShowTip("Wash_NoEquip1");
        }
 
    }
 
    private int GetWashCheckUseGoldAttr()
    {
        int code = 0;
        if (_attackWashPro.toggleIsOn)
        {
            code += 1;
        }
        if (_lifeWashPro.toggleIsOn)
        {
            code += 2;
        }
        if (_ignoreDefenceWashPro.toggleIsOn)
        {
            code += 4;
        }
        return code;
    }
 
    private void OnClickSaveBtn(bool needSave = true)
    {
 
        CA326_tagCMEquipXLAttrChangeOK result = new CA326_tagCMEquipXLAttrChangeOK();
        result.EquipPlace = (byte)_washProModel.EquipPlace;
        result.IsSave = 1;
        GameNetSystem.Instance.SendInfo(result);
    }
 
    private void OnClickCancelBtn()
    {
        CA326_tagCMEquipXLAttrChangeOK result = new CA326_tagCMEquipXLAttrChangeOK();
        result.EquipPlace = (byte)_washProModel.EquipPlace;
        result.IsSave = 0;
        GameNetSystem.Instance.SendInfo(result);
 
    }
 
    private void OnClickUpGradeBtn()
    {
        CA326_tagCMEquipXLAttrChangeOK result = new CA326_tagCMEquipXLAttrChangeOK();
        result.EquipPlace = (byte)_washProModel.EquipPlace;
        result.IsSave = 2;
        GameNetSystem.Instance.SendInfo(result);
    }
 
    private void OnClickMasterBtn()
    {
        int type = equipWashModel.OnGetWashType(_washProModel.EquipPlace);
        equipWashModel.OnGetMasterModel(_washInfolist);
        int groupLv = 0;
        switch(type)
        {
            case 1:
                groupLv = equipWashModel.washGroup1[0].XLAttrLV;
                break;
            case 2:
                groupLv = equipWashModel.washGroup2[0].XLAttrLV;
                break;
            case 3:
                groupLv = equipWashModel.washGroup3[0].XLAttrLV;
                break;
        }
        equipWashModel.SetWashMasterModel(type,groupLv);
        WindowCenter.Instance.Open<WashMasterWin>();
    }
 
    private void OnClickRuleBtn()
    {
    }
    #endregion
 
    public List<string> GetCostMoneyList()
    {
        if (_costMoneylist != null)
            return _costMoneylist;
        else
            return null;
    }
 
    private List<string> GetToolsList(string tools, List<string> toolslist)
    {
        toolslist = new List<string>();
        string[] toolsArray = tools.Split('|');
        for (int i = 0; i < toolsArray.Length; i++)
        {
            toolslist.Add(toolsArray[i]);
        }
        return toolslist;
 
    }
 
}