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
|
using System;
using UnityEngine;
using XUtliPoolLib;
namespace XMainClient
{
internal class XCombatHUDMgr : XSingleton<XCombatHUDMgr>
{
public static string HUD_NORMAL = "UI/Billboard/HUDNormal2";
public static string HUD_CRITICAL = "UI/Billboard/HUDCritical";
public static string HUD_POFANG = "UI/Billboard/HUDPofang";
public static string HUD_PLAYER = "UI/Billboard/HUDPlayer";
public static string HUD_IMMORTAL = "UI/Billboard/HUDImmortal";
public static string HUD_MISS = "UI/Billboard/HUDMiss";
public bool Initialize()
{
return true;
}
public GameObject GetHUDTemplateByDamageResult(ProjectDamageResult config, bool isPlayer)
{
bool flag = config.Result == ProjectResultType.PJRES_IMMORTAL;
GameObject result;
if (flag)
{
GameObject gameObject = XSingleton<XResourceLoaderMgr>.singleton.CreateFromPrefab(XCombatHUDMgr.HUD_IMMORTAL, Vector3.zero, Quaternion.identity, true, false);
result = gameObject;
}
else
{
bool flag2 = config.Result == ProjectResultType.PJRES_MISS;
if (flag2)
{
GameObject gameObject = XSingleton<XResourceLoaderMgr>.singleton.CreateFromPrefab(XCombatHUDMgr.HUD_MISS, Vector3.zero, Quaternion.identity, true, false);
result = gameObject;
}
else if (isPlayer)
{
GameObject gameObject = XSingleton<XResourceLoaderMgr>.singleton.CreateFromPrefab(XCombatHUDMgr.HUD_PLAYER, Vector3.zero, Quaternion.identity, true, false);
result = gameObject;
}
else
{
bool flag3 = config.IsCritical();
GameObject gameObject;
if (flag3)
{
gameObject = XSingleton<XResourceLoaderMgr>.singleton.CreateFromPrefab(XCombatHUDMgr.HUD_CRITICAL, Vector3.zero, Quaternion.identity, true, false);
}
else
{
gameObject = XSingleton<XResourceLoaderMgr>.singleton.CreateFromPrefab(XCombatHUDMgr.HUD_NORMAL, Vector3.zero, Quaternion.identity, true, false);
}
result = gameObject;
}
}
return result;
}
public string GetHUDText(ProjectDamageResult config, bool isDigitalText)
{
string text = "";
bool flag = config.Result == ProjectResultType.PJRES_IMMORTAL;
string result;
if (flag)
{
result = XStringDefineProxy.GetString("BATTLE_IMMORTAL");
}
else
{
bool accept = config.Accept;
if (accept)
{
string elementSprite = this.GetElementSprite(config.ElementType);
text = elementSprite;
float num = (float)config.Value;
text += ((num > 0f) ? Mathf.RoundToInt(num).ToString() : Mathf.RoundToInt(-num).ToString());
}
result = text;
}
return result;
}
public string GetElementSprite(DamageElement element)
{
string result;
switch (element)
{
case DamageElement.DE_FIRE:
result = "c";
break;
case DamageElement.DE_WATER:
result = "b";
break;
case DamageElement.DE_LIGHT:
result = "a";
break;
case DamageElement.DE_DARK:
result = "d";
break;
default:
result = "";
break;
}
return result;
}
public void GetElementColor(DamageElement element, ref bool applyGradient, ref Color top, ref Color bottom)
{
switch (element)
{
case DamageElement.DE_FIRE:
applyGradient = true;
top = new Color32(173, 60, 58, byte.MaxValue);
bottom = new Color32(121, 33, 32, byte.MaxValue);
break;
case DamageElement.DE_WATER:
top = new Color32(103, 209, 228, byte.MaxValue);
bottom = new Color32(54, 121, 131, byte.MaxValue);
applyGradient = true;
break;
case DamageElement.DE_LIGHT:
top = new Color32(234, 226, 156, byte.MaxValue);
bottom = new Color32(178, 182, 117, byte.MaxValue);
applyGradient = true;
break;
case DamageElement.DE_DARK:
top = new Color32(149, 140, 237, byte.MaxValue);
bottom = new Color32(104, 95, 169, byte.MaxValue);
applyGradient = true;
break;
default:
applyGradient = false;
break;
}
}
}
}
|