少年修仙传客户端代码仓库
client_Wu Xijin
2019-02-25 cdb0198fb8e85811ec1e06b15f36df9cbe0fdb9a
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
using System;
using UnityEngine;
using UnityEngine.UI;
 
namespace Snxxz.UI
{
    public class FairylandCeremonyWin : Window
    {
        [SerializeField] FunctionButtonGroup funcBtnGroup;
        [SerializeField] FunctionButton rechargeFunc;
        [SerializeField] FunctionButton fireFunc;
        [SerializeField] FunctionButton peopleToHiFunc;
        [SerializeField] FunctionButton outofFunc;
        [SerializeField] Button leftBtn;
        [SerializeField] Button rightBtn;
        [SerializeField] Button closeBtn;
 
        FairylandCeremonyModel ceremonyModel { get { return ModelCenter.Instance.GetModel<FairylandCeremonyModel>(); } }
 
        protected override void BindController()
        {
 
        }
 
        protected override void AddListeners()
        {
            rechargeFunc.onClick.AddListener(ClickRecharge);
            fireFunc.onClick.AddListener(ClickFire);
            peopleToHiFunc.onClick.AddListener(ClickPeopleToHi);
            outofFunc.onClick.AddListener(ClickOutOf);
            leftBtn.onClick.AddListener(OnClickLeftBtn);
            rightBtn.onClick.AddListener(OnClickRightBtn);
            closeBtn.onClick.AddListener(ClickClose);
        }
 
        protected override void OnPreOpen()
        {
 
        }
        protected override void OnActived()
        {
            base.OnActived();
            if (!WindowJumpMgr.Instance.IsJumpState && functionOrder == 0)
            {
                if (ceremonyModel.rechargeRedp.state == RedPointState.Simple)
                {
                    functionOrder = rechargeFunc.order;
                }
                else if (ceremonyModel.peopleRedp.state == RedPointState.Simple)
                {
                    functionOrder = peopleToHiFunc.order;
                }
            }
            funcBtnGroup.TriggerByOrder(functionOrder);
        }
 
        protected override void OnAfterOpen()
        {
 
        }
 
        protected override void OnPreClose()
        {
 
        }
 
        protected override void OnAfterClose()
        {
            if (!WindowJumpMgr.Instance.IsJumpState)
            {
                WindowCenter.Instance.Open<MainInterfaceWin>();
            }
        }
 
        private void OnClickRightBtn()
        {
            funcBtnGroup.TriggerNext();
        }
 
        private void OnClickLeftBtn()
        {
            funcBtnGroup.TriggerLast();
        }
 
        private void ClickOutOf()
        {
            CloseChildWin();
            WindowCenter.Instance.Open<CeremonyOutOfPrintWin>();
            functionOrder = 3;
        }
 
        private void ClickPeopleToHi()
        {
            CloseChildWin();
            WindowCenter.Instance.Open<CeremonyPeopleToHiWin>();
            functionOrder = 2;
        }
 
        private void ClickFire()
        {
            CloseChildWin();
            WindowCenter.Instance.Open<CeremonyFirepartyWin>();
            functionOrder = 1;
        }
 
        private void ClickRecharge()
        {
            CloseChildWin();
            WindowCenter.Instance.Open<CeremonyRechargeGiftWin>();
            functionOrder = 0;
        }
 
        private void CloseChildWin()
        {
            var children = WindowConfig.Get().FindChildWindows("FairylandCeremonyWin");
            foreach (var window in children)
            {
                WindowCenter.Instance.Close(window);
            }
        }
 
 
        private void ClickClose()
        {
            CloseChildWin();
            CloseClick();
        }
    }
}