Elin Decompiled Documentation EA 23.102 Nightly
Loading...
Searching...
No Matches
DepthEffect Class Reference
Inheritance diagram for DepthEffect:

Public Member Functions

override void ModifyMesh (VertexHelper vh)
 

Protected Member Functions

 DepthEffect ()
 
void ApplyShadowZeroAlloc (List< UIVertex > verts, Color32 color, int start, int end, float x, float y, float factor)
 

Properties

Color effectColor [get, set]
 
Vector2 effectDirectionAndDepth [get, set]
 
Vector2 depthPerspectiveStrength [get, set]
 
bool onlyInitialCharactersGenerateDepth [get, set]
 
bool useGraphicAlpha [get, set]
 

Private Attributes

Color m_EffectColor = new Color(0f, 0f, 0f, 1f)
 
Vector2 m_EffectDirectionAndDepth = new Vector2(-1f, 1f)
 
Vector2 m_DepthPerspectiveStrength = new Vector2(0f, 0f)
 
bool m_OnlyInitialCharactersGenerateDepth = true
 
bool m_UseGraphicAlpha = true
 
Vector2 m_OverallTextSize = Vector2.zero
 
Vector2 m_TopLeftPos = Vector2.zero
 
Vector2 m_BottomRightPos = Vector2.zero
 
List< UIVertex > m_Verts = new List<UIVertex>()
 

Detailed Description

Definition at line 7 of file DepthEffect.cs.

Constructor & Destructor Documentation

◆ DepthEffect()

DepthEffect.DepthEffect ( )
inlineprotected

Definition at line 118 of file DepthEffect.cs.

119 {
120 }

Member Function Documentation

◆ ApplyShadowZeroAlloc()

void DepthEffect.ApplyShadowZeroAlloc ( List< UIVertex >  verts,
Color32  color,
int  start,
int  end,
float  x,
float  y,
float  factor 
)
inlineprotected

Definition at line 122 of file DepthEffect.cs.

123 {
124 for (int i = start; i < end; i++)
125 {
126 UIVertex uIVertex = verts[i];
127 verts.Add(uIVertex);
128 Vector3 position = uIVertex.position;
129 position.x += x * factor;
130 if (depthPerspectiveStrength.x != 0f)
131 {
132 position.x -= depthPerspectiveStrength.x * ((position.x - m_TopLeftPos.x) / m_OverallTextSize.x - 0.5f) * factor;
133 }
134 position.y += y * factor;
135 if (depthPerspectiveStrength.y != 0f)
136 {
137 position.y += depthPerspectiveStrength.y * ((m_TopLeftPos.y - position.y) / m_OverallTextSize.y - 0.5f) * factor;
138 }
139 uIVertex.position = position;
140 Color32 color2 = color;
141 if (useGraphicAlpha)
142 {
143 color2.a = (byte)(color2.a * verts[i].color.a / 255);
144 }
145 uIVertex.color = color2;
146 verts[i] = uIVertex;
147 }
148 }
Vector2 m_TopLeftPos
Definition: DepthEffect.cs:26
Vector2 m_OverallTextSize
Definition: DepthEffect.cs:24
bool useGraphicAlpha
Definition: DepthEffect.cs:103
Vector2 depthPerspectiveStrength
Definition: DepthEffect.cs:68

References depthPerspectiveStrength, m_OverallTextSize, m_TopLeftPos, and useGraphicAlpha.

Referenced by ModifyMesh().

◆ ModifyMesh()

override void DepthEffect.ModifyMesh ( VertexHelper  vh)
inline

Definition at line 150 of file DepthEffect.cs.

151 {
152 if (!IsActive())
153 {
154 return;
155 }
156 vh.GetUIVertexStream(m_Verts);
157 int count = m_Verts.Count;
158 Text component = GetComponent<Text>();
159 int num = 0;
160 int num2 = m_Verts.Count;
162 {
163 num = m_Verts.Count - component.cachedTextGenerator.characterCountVisible * 6;
164 num2 = component.cachedTextGenerator.characterCountVisible * 6;
165 }
166 if (num2 == 0)
167 {
168 return;
169 }
171 {
172 m_TopLeftPos = m_Verts[num].position;
173 m_BottomRightPos = m_Verts[num + num2 - 1].position;
174 for (int i = num; i < num + num2; i++)
175 {
176 if (m_Verts[i].position.x < m_TopLeftPos.x)
177 {
178 m_TopLeftPos.x = m_Verts[i].position.x;
179 }
180 if (m_Verts[i].position.y > m_TopLeftPos.y)
181 {
182 m_TopLeftPos.y = m_Verts[i].position.y;
183 }
184 if (m_Verts[i].position.x > m_BottomRightPos.x)
185 {
186 m_BottomRightPos.x = m_Verts[i].position.x;
187 }
188 if (m_Verts[i].position.y < m_BottomRightPos.y)
189 {
190 m_BottomRightPos.y = m_Verts[i].position.y;
191 }
192 }
194 }
195 int num3 = num;
196 num3 = num;
197 int count2 = m_Verts.Count;
199 num3 = count2;
200 int count3 = m_Verts.Count;
202 num3 = count3;
203 int count4 = m_Verts.Count;
205 num3 = count4;
206 _ = m_Verts.Count;
209 {
210 List<UIVertex> range = m_Verts.GetRange(0, count - num2);
211 m_Verts.RemoveRange(0, count - num2);
212 m_Verts.InsertRange(m_Verts.Count - num2, range);
213 }
214 if (component.material.shader == Shader.Find("Text Effects/Fancy Text"))
215 {
216 for (int j = 0; j < m_Verts.Count - count; j++)
217 {
218 UIVertex value = m_Verts[j];
219 value.uv1 = new Vector2(0f, 0f);
220 m_Verts[j] = value;
221 }
222 }
223 vh.Clear();
224 vh.AddUIVertexTriangleStream(m_Verts);
225 }
List< UIVertex > m_Verts
Definition: DepthEffect.cs:30
bool onlyInitialCharactersGenerateDepth
Definition: DepthEffect.cs:87
void ApplyShadowZeroAlloc(List< UIVertex > verts, Color32 color, int start, int end, float x, float y, float factor)
Definition: DepthEffect.cs:122
Color effectColor
Definition: DepthEffect.cs:33
Vector2 effectDirectionAndDepth
Definition: DepthEffect.cs:49
Vector2 m_BottomRightPos
Definition: DepthEffect.cs:28
bool m_OnlyInitialCharactersGenerateDepth
Definition: DepthEffect.cs:19

References ApplyShadowZeroAlloc(), depthPerspectiveStrength, effectColor, effectDirectionAndDepth, m_BottomRightPos, m_OnlyInitialCharactersGenerateDepth, m_OverallTextSize, m_TopLeftPos, m_Verts, and onlyInitialCharactersGenerateDepth.

Member Data Documentation

◆ m_BottomRightPos

Vector2 DepthEffect.m_BottomRightPos = Vector2.zero
private

Definition at line 28 of file DepthEffect.cs.

Referenced by ModifyMesh().

◆ m_DepthPerspectiveStrength

Vector2 DepthEffect.m_DepthPerspectiveStrength = new Vector2(0f, 0f)
private

Definition at line 16 of file DepthEffect.cs.

◆ m_EffectColor

Color DepthEffect.m_EffectColor = new Color(0f, 0f, 0f, 1f)
private

Definition at line 10 of file DepthEffect.cs.

◆ m_EffectDirectionAndDepth

Vector2 DepthEffect.m_EffectDirectionAndDepth = new Vector2(-1f, 1f)
private

Definition at line 13 of file DepthEffect.cs.

◆ m_OnlyInitialCharactersGenerateDepth

bool DepthEffect.m_OnlyInitialCharactersGenerateDepth = true
private

Definition at line 19 of file DepthEffect.cs.

Referenced by ModifyMesh().

◆ m_OverallTextSize

Vector2 DepthEffect.m_OverallTextSize = Vector2.zero
private

Definition at line 24 of file DepthEffect.cs.

Referenced by ApplyShadowZeroAlloc(), and ModifyMesh().

◆ m_TopLeftPos

Vector2 DepthEffect.m_TopLeftPos = Vector2.zero
private

Definition at line 26 of file DepthEffect.cs.

Referenced by ApplyShadowZeroAlloc(), and ModifyMesh().

◆ m_UseGraphicAlpha

bool DepthEffect.m_UseGraphicAlpha = true
private

Definition at line 22 of file DepthEffect.cs.

◆ m_Verts

List<UIVertex> DepthEffect.m_Verts = new List<UIVertex>()
private

Definition at line 30 of file DepthEffect.cs.

Referenced by ModifyMesh().

Property Documentation

◆ depthPerspectiveStrength

Vector2 DepthEffect.depthPerspectiveStrength
getset

Definition at line 67 of file DepthEffect.cs.

68 {
69 get
70 {
72 }
73 set
74 {
75 if (!(m_DepthPerspectiveStrength == value))
76 {
78 if (base.graphic != null)
79 {
80 base.graphic.SetVerticesDirty();
81 }
82 }
83 }
84 }
Vector2 m_DepthPerspectiveStrength
Definition: DepthEffect.cs:16

Referenced by ApplyShadowZeroAlloc(), and ModifyMesh().

◆ effectColor

Color DepthEffect.effectColor
getset

Definition at line 32 of file DepthEffect.cs.

33 {
34 get
35 {
36 return m_EffectColor;
37 }
38 set
39 {
40 m_EffectColor = value;
41 if (base.graphic != null)
42 {
43 base.graphic.SetVerticesDirty();
44 }
45 }
46 }
Color m_EffectColor
Definition: DepthEffect.cs:10

Referenced by ModifyMesh().

◆ effectDirectionAndDepth

Vector2 DepthEffect.effectDirectionAndDepth
getset

Definition at line 48 of file DepthEffect.cs.

49 {
50 get
51 {
53 }
54 set
55 {
56 if (!(m_EffectDirectionAndDepth == value))
57 {
59 if (base.graphic != null)
60 {
61 base.graphic.SetVerticesDirty();
62 }
63 }
64 }
65 }
Vector2 m_EffectDirectionAndDepth
Definition: DepthEffect.cs:13

Referenced by ModifyMesh().

◆ onlyInitialCharactersGenerateDepth

bool DepthEffect.onlyInitialCharactersGenerateDepth
getset

Definition at line 86 of file DepthEffect.cs.

87 {
88 get
89 {
91 }
92 set
93 {
95 if (base.graphic != null)
96 {
97 base.graphic.SetVerticesDirty();
98 }
99 }
100 }

Referenced by ModifyMesh().

◆ useGraphicAlpha

bool DepthEffect.useGraphicAlpha
getset

Definition at line 102 of file DepthEffect.cs.

103 {
104 get
105 {
106 return m_UseGraphicAlpha;
107 }
108 set
109 {
110 m_UseGraphicAlpha = value;
111 if (base.graphic != null)
112 {
113 base.graphic.SetVerticesDirty();
114 }
115 }
116 }
bool m_UseGraphicAlpha
Definition: DepthEffect.cs:22

Referenced by ApplyShadowZeroAlloc().


The documentation for this class was generated from the following file: