少年修仙传客户端代码仓库
client_Wu Xijin
2019-03-05 efa5f8d07fc3321f6ac5f5d97fb422db28d0886f
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
//--------------------------------------------------------
//    [Author]:           第二世界
//    [  Date ]:           Tuesday, February 19, 2019
//--------------------------------------------------------
using UnityEngine;
using System.Collections;
using UnityEngine.UI;
using DG.Tweening;
 
namespace Snxxz.UI
{
 
    public class MainPositionTween : MonoBehaviour
    {
        [Header("主界面顶部上下切换模块")]
        public float CopyOfThePanelSpeed = 1f;//副本面板移动速度
        [SerializeField] Transform m_CopyOfThePanel;
        [SerializeField] Transform m_CopyOfThePosition1;
        [SerializeField] Transform m_CopyOfThePosition2;
        [SerializeField] Transform m_ContainerBossList;
        [Header("主界面技能面板切换模块")]
        public float SwitchSkillTipAndButtonTipSpeed = 1.2f;//技能面板和按钮面板的移动速度
        [SerializeField] Transform m_CastSkillTip;//技能面板
        [SerializeField] Transform m_position1_S;
        [SerializeField] Transform m_position2_S;
        [SerializeField] AnimationFadeOut m_AnimationFadeOut;//右下角按钮组
        [Header("主界面任务模块")]
        public float TaskSpeed = 0.2f;//任务面板移动的速度
        [SerializeField] Transform m_TaskAndTeamPanel;
        [SerializeField] Transform m_TaskListTipAnchor1;
        [SerializeField] Transform m_TaskListTipAnchor2;
        [SerializeField] GameObject m_LeftImage;
        [SerializeField] GameObject m_RightImg;
        [Header("功能预告模块")]
        [SerializeField] Transform m_FunctionForecastPanel;
        [SerializeField] Transform m_unctionForecastPosition1;
        [SerializeField] Transform m_unctionForecastPosition2;
        [Header("切换按钮旋转")]
        public Vector3 Vec3 = new Vector3(0f, 0f, 225f);//切换旋转的角度
        [SerializeField] Transform m_ImageRotation;//切换滚动
        public bool IsSetCopyOfThePanelShow
        {
            get
            {
                return (m_CopyOfThePanel.position - m_CopyOfThePosition1.position).sqrMagnitude < (2.5 * 2.5);
            }
        }
        public void SetCopyOfThePanelPos(bool _bool)
        {
            if (_bool)
            {
                m_CopyOfThePanel.localPosition = m_CopyOfThePosition1.localPosition;
            }
            else
            {
                m_CopyOfThePanel.localPosition = m_CopyOfThePosition2.localPosition;
            }
        }
        public void SetCopyOfThePanelTweenPos(bool _bool)
        {
            if (_bool)
            {
                m_CopyOfThePanel.DOLocalMoveY(m_CopyOfThePosition1.localPosition.y, CopyOfThePanelSpeed);
            }
            else
            {
                m_CopyOfThePanel.DOLocalMoveY(m_CopyOfThePosition2.localPosition.y, CopyOfThePanelSpeed);
            }
        }
        public void SetBossListPos(bool _bool)
        {
            if (_bool)
            {
                m_ContainerBossList.localPosition = m_CopyOfThePosition1.localPosition;
            }
            else
            {
                m_ContainerBossList.localPosition = m_CopyOfThePosition2.localPosition;
            }
        }
        public void SetBossListTweenPos(bool _bool)
        {
            if (_bool)
            {
                m_ContainerBossList.DOLocalMoveY(m_CopyOfThePosition1.localPosition.y, CopyOfThePanelSpeed);
            }
            else
            {
                m_ContainerBossList.DOLocalMoveY(m_CopyOfThePosition2.localPosition.y, CopyOfThePanelSpeed);
            }
        }
        public void SetTipAndBossPos(bool _bool)
        {
            if (_bool)
            {
                SetCopyOfThePanelPos(true);
                SetBossListPos(false);
            }
            else
            {
                SetCopyOfThePanelPos(false);
                SetBossListPos(true);
            }
        }
        public void SetTipAndBossTweenPos(bool _bool)
        {
            if (_bool)
            {
                SetCopyOfThePanelTweenPos(true);
                SetBossListTweenPos(false);
            }
            else
            {
                SetCopyOfThePanelTweenPos(false);
                SetBossListTweenPos(true);
            }
        }
        //-----------------------------
        public bool IsRightTipPanelShow
        {
            get
            {
                return (m_CastSkillTip.position - m_position1_S.position).sqrMagnitude < 1;
            }
        }
        public void SetSkillTipOrRightTipPos(bool _bool)
        {
            if (_bool)
            {
                m_AnimationFadeOut.FadeAtOnce();
                m_CastSkillTip.localPosition = m_position1_S.localPosition;
            }
            else
            {
                m_AnimationFadeOut.ImmediatelyAppear();
                m_CastSkillTip.localPosition = m_position2_S.localPosition;
            }
        }
        public void SetSkillTipOrRightTipPosTween(bool _bool)
        {
            if (_bool)
            {
                m_AnimationFadeOut.FadeOut();
                m_CastSkillTip.DOLocalMoveX(m_position1_S.localPosition.x, SwitchSkillTipAndButtonTipSpeed);
            }
            else
            {
                m_AnimationFadeOut.FadeIn();
                m_CastSkillTip.DOLocalMoveX(m_position2_S.localPosition.x, SwitchSkillTipAndButtonTipSpeed);
            }
        }
        //----------------------------
        public bool IsTaskAndPanelShow
        {
            get
            {
                return (m_TaskAndTeamPanel.localPosition - m_TaskListTipAnchor1.localPosition).sqrMagnitude < 3*3;
            }
        }
        public void SetTaskPos(bool _bool)
        {
            if (_bool)
            {
                m_TaskAndTeamPanel.localPosition = m_TaskListTipAnchor1.localPosition;
            }
            else
            {
                m_TaskAndTeamPanel.localPosition = m_TaskListTipAnchor2.localPosition;
            }
        }
        public void SetTaskPosTween(bool _bool)
        {
            if (_bool)
            {
                m_TaskAndTeamPanel.DOLocalMoveX(m_TaskListTipAnchor1.localPosition.x, TaskSpeed);
                m_LeftImage.SetActive(true);
                m_RightImg.SetActive(false);
            }
            else
            {
                m_TaskAndTeamPanel.DOLocalMoveX(m_TaskListTipAnchor2.localPosition.x, TaskSpeed);
                m_LeftImage.SetActive(false);
                m_RightImg.SetActive(true);
            }
        }
        //-----------------------------
        public void SetFunctionForecastPos(bool _bool)
        {
            if (_bool)
            {
                m_FunctionForecastPanel.localPosition = m_unctionForecastPosition1.localPosition;
            }
            else
            {
                m_FunctionForecastPanel.localPosition = m_unctionForecastPosition2.localPosition;
            }
        }
        public void SetFunctionForecastPosTween(bool _bool)
        {
            if (_bool)
            {
                m_FunctionForecastPanel.DOLocalMoveX(m_unctionForecastPosition1.localPosition.x, TaskSpeed);
            }
            else
            {
                m_FunctionForecastPanel.DOLocalMoveX(m_unctionForecastPosition2.localPosition.x, TaskSpeed);
            }
        }
        //--------------------------------
        public void SetRotation(bool _bool)
        {
            if (_bool)
            {
                m_ImageRotation.DOLocalRotate(Vec3, SwitchSkillTipAndButtonTipSpeed);
            }
            else
            {
                m_ImageRotation.DOLocalRotate(Vector3.zero, SwitchSkillTipAndButtonTipSpeed);
            }
        }
    }
 
}