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

Public Member Functions

override void ModifyMesh (VertexHelper vh)
 

Protected Member Functions

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

Properties

Color effectColor [get, set]
 
Vector2 effectDistance [get, set]
 
bool useGraphicAlpha [get, set]
 

Private Attributes

Color m_EffectColor = new Color(0f, 0f, 0f, 0.5f)
 
Vector2 m_EffectDistance = new Vector2(1f, -1f)
 
bool m_UseGraphicAlpha = true
 
List< UIVertex > m_Verts = new List<UIVertex>()
 

Detailed Description

Definition at line 6 of file ToJShadow.cs.

Constructor & Destructor Documentation

◆ ToJShadow()

ToJShadow.ToJShadow ( )
inlineprotected

Definition at line 86 of file ToJShadow.cs.

87 {
88 }

Member Function Documentation

◆ ApplyShadow()

void ToJShadow.ApplyShadow ( List< UIVertex >  verts,
Color32  color,
int  start,
int  end,
float  x,
float  y 
)
inlineprotected

Definition at line 115 of file ToJShadow.cs.

116 {
117 int num = verts.Count * 2;
118 if (verts.Capacity < num)
119 {
120 verts.Capacity = num;
121 }
122 ApplyShadowZeroAlloc(verts, color, start, end, x, y);
123 }
void ApplyShadowZeroAlloc(List< UIVertex > verts, Color32 color, int start, int end, float x, float y)
Definition: ToJShadow.cs:90

References ApplyShadowZeroAlloc().

Referenced by ModifyMesh().

◆ ApplyShadowZeroAlloc()

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

Definition at line 90 of file ToJShadow.cs.

91 {
92 int num = verts.Count * 2;
93 if (verts.Capacity < num)
94 {
95 verts.Capacity = num;
96 }
97 for (int i = start; i < end; i++)
98 {
99 UIVertex uIVertex = verts[i];
100 verts.Add(uIVertex);
101 Vector3 position = uIVertex.position;
102 position.x += x;
103 position.y += y;
104 uIVertex.position = position;
105 Color32 color2 = color;
107 {
108 color2.a = (byte)(color2.a * verts[i].color.a / 255);
109 }
110 uIVertex.color = color2;
111 verts[i] = uIVertex;
112 }
113 }
bool m_UseGraphicAlpha
Definition: ToJShadow.cs:15

References m_UseGraphicAlpha.

Referenced by ApplyShadow().

◆ ModifyMesh()

override void ToJShadow.ModifyMesh ( VertexHelper  vh)
inline

Definition at line 125 of file ToJShadow.cs.

126 {
127 if (!IsActive())
128 {
129 return;
130 }
131 vh.GetUIVertexStream(m_Verts);
132 int count = m_Verts.Count;
134 Text component = GetComponent<Text>();
135 if (component != null && component.material.shader == Shader.Find("Text Effects/Fancy Text"))
136 {
137 for (int i = 0; i < m_Verts.Count - count; i++)
138 {
139 UIVertex value = m_Verts[i];
140 value.uv1 = new Vector2(0f, 0f);
141 m_Verts[i] = value;
142 }
143 }
144 vh.Clear();
145 vh.AddUIVertexTriangleStream(m_Verts);
146 }
Color effectColor
Definition: ToJShadow.cs:20
List< UIVertex > m_Verts
Definition: ToJShadow.cs:17
Vector2 effectDistance
Definition: ToJShadow.cs:36
void ApplyShadow(List< UIVertex > verts, Color32 color, int start, int end, float x, float y)
Definition: ToJShadow.cs:115

References ApplyShadow(), effectColor, effectDistance, and m_Verts.

Member Data Documentation

◆ m_EffectColor

Color ToJShadow.m_EffectColor = new Color(0f, 0f, 0f, 0.5f)
private

Definition at line 9 of file ToJShadow.cs.

◆ m_EffectDistance

Vector2 ToJShadow.m_EffectDistance = new Vector2(1f, -1f)
private

Definition at line 12 of file ToJShadow.cs.

◆ m_UseGraphicAlpha

bool ToJShadow.m_UseGraphicAlpha = true
private

Definition at line 15 of file ToJShadow.cs.

Referenced by ApplyShadowZeroAlloc().

◆ m_Verts

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

Definition at line 17 of file ToJShadow.cs.

Referenced by ModifyMesh().

Property Documentation

◆ effectColor

Color ToJShadow.effectColor
getset

Definition at line 19 of file ToJShadow.cs.

20 {
21 get
22 {
23 return m_EffectColor;
24 }
25 set
26 {
27 m_EffectColor = value;
28 if (base.graphic != null)
29 {
30 base.graphic.SetVerticesDirty();
31 }
32 }
33 }
Color m_EffectColor
Definition: ToJShadow.cs:9

Referenced by ModifyMesh().

◆ effectDistance

Vector2 ToJShadow.effectDistance
getset

Definition at line 35 of file ToJShadow.cs.

36 {
37 get
38 {
39 return m_EffectDistance;
40 }
41 set
42 {
43 if (value.x > 600f)
44 {
45 value.x = 600f;
46 }
47 if (value.x < -600f)
48 {
49 value.x = -600f;
50 }
51 if (value.y > 600f)
52 {
53 value.y = 600f;
54 }
55 if (value.y < -600f)
56 {
57 value.y = -600f;
58 }
59 if (!(m_EffectDistance == value))
60 {
61 m_EffectDistance = value;
62 if (base.graphic != null)
63 {
64 base.graphic.SetVerticesDirty();
65 }
66 }
67 }
68 }
Vector2 m_EffectDistance
Definition: ToJShadow.cs:12

Referenced by ModifyMesh().

◆ useGraphicAlpha

bool ToJShadow.useGraphicAlpha
getset

Definition at line 70 of file ToJShadow.cs.

71 {
72 get
73 {
74 return m_UseGraphicAlpha;
75 }
76 set
77 {
78 m_UseGraphicAlpha = value;
79 if (base.graphic != null)
80 {
81 base.graphic.SetVerticesDirty();
82 }
83 }
84 }

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