Elin Decompiled Documentation EA 23.102 Nightly
Loading...
Searching...
No Matches
Bevel.cs
Go to the documentation of this file.
1using System.Collections.Generic;
2using UnityEngine;
3using UnityEngine.UI;
4
5[AddComponentMenu("UI/ToJ Effects/Outer Bevel", 4)]
6[RequireComponent(typeof(Text))]
7public class Bevel : BaseMeshEffect
8{
9 [SerializeField]
10 private Color m_HighlightColor = new Color(1f, 1f, 1f, 1f);
11
12 [SerializeField]
13 private Color m_ShadowColor = new Color(0f, 0f, 0f, 1f);
14
15 [SerializeField]
16 private Vector2 m_BevelDirectionAndDepth = new Vector2(1f, 1f);
17
18 [SerializeField]
19 private bool m_UseGraphicAlpha = true;
20
21 private List<UIVertex> m_Verts = new List<UIVertex>();
22
24 {
25 get
26 {
27 return m_HighlightColor;
28 }
29 set
30 {
31 m_HighlightColor = value;
32 if (base.graphic != null)
33 {
34 base.graphic.SetVerticesDirty();
35 }
36 }
37 }
38
40 {
41 get
42 {
43 return m_ShadowColor;
44 }
45 set
46 {
47 m_ShadowColor = value;
48 if (base.graphic != null)
49 {
50 base.graphic.SetVerticesDirty();
51 }
52 }
53 }
54
56 {
57 get
58 {
60 }
61 set
62 {
63 if (!(m_BevelDirectionAndDepth == value))
64 {
66 if (base.graphic != null)
67 {
68 base.graphic.SetVerticesDirty();
69 }
70 }
71 }
72 }
73
74 public bool useGraphicAlpha
75 {
76 get
77 {
78 return m_UseGraphicAlpha;
79 }
80 set
81 {
82 m_UseGraphicAlpha = value;
83 if (base.graphic != null)
84 {
85 base.graphic.SetVerticesDirty();
86 }
87 }
88 }
89
90 protected Bevel()
91 {
92 }
93
94 protected void ApplyShadowZeroAlloc(List<UIVertex> verts, Color32 color, int start, int end, float x, float y)
95 {
96 for (int i = start; i < end; i++)
97 {
98 UIVertex uIVertex = verts[i];
99 verts.Add(uIVertex);
100 Vector3 position = uIVertex.position;
101 position.x += x;
102 position.y += y;
103 uIVertex.position = position;
104 Color32 color2 = color;
105 if (useGraphicAlpha)
106 {
107 color2.a = (byte)(color2.a * verts[i].color.a / 255);
108 }
109 uIVertex.color = color2;
110 verts[i] = uIVertex;
111 }
112 }
113
114 public override void ModifyMesh(VertexHelper vh)
115 {
116 if (!IsActive())
117 {
118 return;
119 }
120 vh.GetUIVertexStream(m_Verts);
121 int count = m_Verts.Count;
122 int num = 0;
123 num = 0;
124 int count2 = m_Verts.Count;
126 num = count2;
127 int count3 = m_Verts.Count;
129 num = count3;
130 int count4 = m_Verts.Count;
132 num = count4;
133 int count5 = m_Verts.Count;
135 num = count5;
136 _ = m_Verts.Count;
138 if (GetComponent<Text>().material.shader == Shader.Find("Text Effects/Fancy Text"))
139 {
140 for (int i = 0; i < m_Verts.Count - count; i++)
141 {
142 UIVertex value = m_Verts[i];
143 value.uv1 = new Vector2(0f, 0f);
144 m_Verts[i] = value;
145 }
146 }
147 vh.Clear();
148 vh.AddUIVertexTriangleStream(m_Verts);
149 }
150}
Definition: Bevel.cs:8
Color shadowColor
Definition: Bevel.cs:40
Color m_ShadowColor
Definition: Bevel.cs:13
Vector2 bevelDirectionAndDepth
Definition: Bevel.cs:56
bool m_UseGraphicAlpha
Definition: Bevel.cs:19
Bevel()
Definition: Bevel.cs:90
Vector2 m_BevelDirectionAndDepth
Definition: Bevel.cs:16
List< UIVertex > m_Verts
Definition: Bevel.cs:21
override void ModifyMesh(VertexHelper vh)
Definition: Bevel.cs:114
bool useGraphicAlpha
Definition: Bevel.cs:75
Color highlightColor
Definition: Bevel.cs:24
void ApplyShadowZeroAlloc(List< UIVertex > verts, Color32 color, int start, int end, float x, float y)
Definition: Bevel.cs:94
Color m_HighlightColor
Definition: Bevel.cs:10