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
|
using System;
using System.Collections.Generic;
using KKSG;
using UILib;
using UnityEngine;
using XMainClient.UI.UICommon;
using XUtliPoolLib;
namespace XMainClient
{
public class MobaKillView : DlgBase<MobaKillView, MobaKillBehaviour>
{
public override string fileName
{
get
{
return "Battle/MobaKillDlg";
}
}
public override int layer
{
get
{
return 1;
}
}
public override bool autoload
{
get
{
return true;
}
}
private Queue<MobaReminder> m_killInfos = new Queue<MobaReminder>();
private XElapseTimer m_showTimer = new XElapseTimer();
public void Enqueue(MobaReminder info)
{
this.m_killInfos.Enqueue(info);
bool flag = !base.IsVisible();
if (flag)
{
this.SetVisibleWithAnimation(true, null);
}
}
protected override void Init()
{
base.Init();
this.m_uiBehaviour.m_playGroup.StopTween();
}
public override void OnUpdate()
{
bool flag = this.m_showTimer != null && this.m_showTimer.LeftTime > 0f;
if (flag)
{
this.m_showTimer.Update();
}
else
{
bool flag2 = this.m_killInfos.Count > 0;
if (flag2)
{
this.SetKillerInfo(this.m_killInfos.Dequeue());
bool flag3 = this.m_showTimer == null;
if (flag3)
{
this.m_showTimer = new XElapseTimer();
}
this.m_showTimer.LeftTime = 3f;
}
else
{
this.SetVisibleWithAnimation(false, null);
}
}
}
private void SetKillerInfo(MobaReminder killInfo)
{
MobaReminderEnum reminder = killInfo.reminder;
if (reminder != MobaReminderEnum.KILLER)
{
if (reminder == MobaReminderEnum.MESSAGE)
{
this.SwichReminderForMessage(killInfo);
}
}
else
{
this.SwichReminderForKiller(killInfo);
}
bool flag = !string.IsNullOrEmpty(killInfo.AudioName);
if (flag)
{
XSingleton<XAudioMgr>.singleton.PlayUISound(killInfo.AudioName, true, AudioChannel.Action);
}
base.uiBehaviour.m_playGroup.ResetTween(true);
base.uiBehaviour.m_playGroup.PlayTween(true);
killInfo.Recycle();
}
private void SwichReminderForMessage(MobaReminder killInfo)
{
base.uiBehaviour.KillTransform.gameObject.SetActive(false);
base.uiBehaviour.MessageTransform.gameObject.SetActive(true);
base.uiBehaviour.m_MessageLabel.SetText(killInfo.ReminderText);
}
private void SwichReminderForKiller(MobaReminder killInfo)
{
base.uiBehaviour.KillTransform.gameObject.SetActive(true);
base.uiBehaviour.MessageTransform.gameObject.SetActive(false);
this.SetHeader(base.uiBehaviour.m_leftHeader, killInfo.killer);
this.SetHeader(base.uiBehaviour.m_rightHeader, killInfo.deader);
int i = 0;
int num = base.uiBehaviour.m_killTypes.Length;
while (i < num)
{
bool flag = base.uiBehaviour.m_killTypes[i] == null;
if (!flag)
{
base.uiBehaviour.m_killTypes[i].gameObject.SetActive(i == killInfo.type);
}
i++;
}
base.uiBehaviour.m_helpMembers.ReturnAll(false);
bool flag2 = killInfo.assists.Count > 0;
if (flag2)
{
base.uiBehaviour.m_helpTransform.gameObject.SetActive(true);
i = 0;
num = killInfo.assists.Count;
while (i < num)
{
GameObject gameObject = base.uiBehaviour.m_helpMembers.FetchGameObject(false);
gameObject.transform.localScale = Vector3.one;
gameObject.transform.localPosition = new Vector3(0f, (float)(base.uiBehaviour.m_helpMembers.TplWidth * i), 0f);
this.SetHeader(gameObject.transform, killInfo.assists[i]);
i++;
}
}
else
{
base.uiBehaviour.m_helpTransform.gameObject.SetActive(false);
}
}
private void SetHeader(Transform t, HeroKillUnit unit)
{
IXUISprite ixuisprite = t.Find("HeroIcon").GetComponent("XUISprite") as IXUISprite;
IXUISprite ixuisprite2 = t.Find("team").GetComponent("XUISprite") as IXUISprite;
XMobaBattleDocument specificDocument = XDocuments.GetSpecificDocument<XMobaBattleDocument>(XMobaBattleDocument.uuID);
ixuisprite2.SetSprite(specificDocument.isAlly((int)unit.teamid) ? "HeroHeadB" : "HeroHeadR");
string strAtlas = "";
string strSprite = "";
bool flag = unit.type == HeroKillUnitType.HeroKillUnit_Hero;
if (flag)
{
XHeroBattleDocument.GetIconByHeroID(unit.id, out strAtlas, out strSprite);
}
else
{
XEntityStatistics.RowData byID = XSingleton<XEntityMgr>.singleton.EntityStatistics.GetByID(unit.id);
bool flag2 = byID != null;
if (flag2)
{
XEntityPresentation.RowData byPresentID = XSingleton<XEntityMgr>.singleton.EntityInfo.GetByPresentID(byID.PresentID);
bool flag3 = byPresentID != null;
if (flag3)
{
strAtlas = byPresentID.Atlas2;
strSprite = byPresentID.Avatar2;
}
}
}
ixuisprite.SetSprite(strSprite, strAtlas, false);
}
}
}
|