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

Public Types

enum  ColorMode { Override , Additive , Multiply }
 

Public Member Functions

override void ModifyMesh (VertexHelper vh)
 
virtual Material GetModifiedMaterial (Material baseMaterial)
 

Public Attributes

Color m_HighlightColor = Color.white
 
Color m_ShadowColor = Color.black
 

Protected Member Functions

 InnerBevel ()
 
override void Start ()
 

Properties

ColorMode highlightColorMode [get, set]
 
Color highlightColor [get, set]
 
ColorMode shadowColorMode [get, set]
 
Color shadowColor [get, set]
 
Vector2 bevelDirectionAndDepth [get, set]
 

Private Member Functions

void Update ()
 

Private Attributes

ColorMode m_HighlightColorMode
 
ColorMode m_ShadowColorMode
 
Vector2 m_BevelDirectionAndDepth = new Vector2(1f, 1f)
 
bool m_NeedsToSetMaterialDirty
 
Material m_ModifiedMaterial
 
List< UIVertex > m_Verts = new List<UIVertex>()
 

Detailed Description

Definition at line 8 of file InnerBevel.cs.

Member Enumeration Documentation

◆ ColorMode

Enumerator
Override 
Additive 
Multiply 

Definition at line 10 of file InnerBevel.cs.

Constructor & Destructor Documentation

◆ InnerBevel()

InnerBevel.InnerBevel ( )
inlineprotected

Definition at line 121 of file InnerBevel.cs.

122 {
123 }

Member Function Documentation

◆ GetModifiedMaterial()

virtual Material InnerBevel.GetModifiedMaterial ( Material  baseMaterial)
inlinevirtual

Definition at line 178 of file InnerBevel.cs.

179 {
180 if (!IsActive())
181 {
182 return baseMaterial;
183 }
184 if (baseMaterial.shader != Shader.Find("Text Effects/Fancy Text"))
185 {
186 Debug.Log("\"" + base.gameObject.name + "\" doesn't have the \"Fancy Text\" shader applied. Please use it if you are using the \"Inner Bevel\" effect.");
187 return baseMaterial;
188 }
189 if (m_ModifiedMaterial == null)
190 {
191 m_ModifiedMaterial = new Material(baseMaterial);
192 }
193 m_ModifiedMaterial.CopyPropertiesFromMaterial(baseMaterial);
194 m_ModifiedMaterial.name = baseMaterial.name + " with IB";
195 m_ModifiedMaterial.hideFlags = HideFlags.HideInHierarchy | HideFlags.HideInInspector;
196 m_ModifiedMaterial.shaderKeywords = baseMaterial.shaderKeywords;
197 m_ModifiedMaterial.CopyPropertiesFromMaterial(baseMaterial);
198 m_ModifiedMaterial.EnableKeyword("_USEBEVEL_ON");
199 m_ModifiedMaterial.SetColor("_HighlightColor", highlightColor);
200 m_ModifiedMaterial.SetColor("_ShadowColor", shadowColor);
201 m_ModifiedMaterial.SetVector("_HighlightOffset", bevelDirectionAndDepth / 500f);
202 m_ModifiedMaterial.SetInt("_HighlightColorMode", (int)highlightColorMode);
203 m_ModifiedMaterial.SetInt("_ShadowColorMode", (int)shadowColorMode);
205 return m_ModifiedMaterial;
206 }
Color shadowColor
Definition: InnerBevel.cs:87
Material m_ModifiedMaterial
Definition: InnerBevel.cs:34
Vector2 bevelDirectionAndDepth
Definition: InnerBevel.cs:103
Color highlightColor
Definition: InnerBevel.cs:55
ColorMode shadowColorMode
Definition: InnerBevel.cs:71
ColorMode highlightColorMode
Definition: InnerBevel.cs:39
bool m_NeedsToSetMaterialDirty
Definition: InnerBevel.cs:32

References bevelDirectionAndDepth, Debug, highlightColor, highlightColorMode, m_ModifiedMaterial, m_NeedsToSetMaterialDirty, Material, shadowColor, and shadowColorMode.

◆ ModifyMesh()

override void InnerBevel.ModifyMesh ( VertexHelper  vh)
inline

Definition at line 133 of file InnerBevel.cs.

134 {
135 if (!IsActive())
136 {
137 return;
138 }
139 vh.GetUIVertexStream(m_Verts);
140 int count = m_Verts.Count;
141 for (int i = 0; i < count; i += 6)
142 {
143 UIVertex value = m_Verts[i];
144 Vector2 vector = (m_Verts[i + 1].uv0 - m_Verts[i].uv0).normalized;
145 Vector2 vector2 = (m_Verts[i + 1].uv0 - m_Verts[i + 2].uv0).normalized;
146 Vector4 tangent = vector;
147 tangent.z = vector2.x;
148 tangent.w = vector2.y;
149 value.tangent = tangent;
150 if (value.uv1 == Vector4.zero)
151 {
152 value.uv1 = new Vector2(1f, 1f);
153 }
154 m_Verts[i] = value;
155 for (int j = 1; j < 6; j++)
156 {
157 value = m_Verts[i + j];
158 value.tangent = m_Verts[i].tangent;
159 if (value.uv1 == Vector4.zero)
160 {
161 value.uv1 = new Vector2(1f, 1f);
162 }
163 m_Verts[i + j] = value;
164 }
165 }
166 vh.Clear();
167 vh.AddUIVertexTriangleStream(m_Verts);
168 }
List< UIVertex > m_Verts
Definition: InnerBevel.cs:36

References m_Verts.

◆ Start()

override void InnerBevel.Start ( )
inlineprotected

Definition at line 125 of file InnerBevel.cs.

126 {
127 if (base.graphic != null)
128 {
129 base.graphic.SetMaterialDirty();
130 }
131 }

◆ Update()

void InnerBevel.Update ( )
inlineprivate

Definition at line 170 of file InnerBevel.cs.

171 {
172 if (m_NeedsToSetMaterialDirty && base.graphic != null)
173 {
174 base.graphic.SetMaterialDirty();
175 }
176 }

References m_NeedsToSetMaterialDirty.

Member Data Documentation

◆ m_BevelDirectionAndDepth

Vector2 InnerBevel.m_BevelDirectionAndDepth = new Vector2(1f, 1f)
private

Definition at line 30 of file InnerBevel.cs.

◆ m_HighlightColor

Color InnerBevel.m_HighlightColor = Color.white

Definition at line 21 of file InnerBevel.cs.

◆ m_HighlightColorMode

ColorMode InnerBevel.m_HighlightColorMode
private

Definition at line 18 of file InnerBevel.cs.

◆ m_ModifiedMaterial

Material InnerBevel.m_ModifiedMaterial
private

Definition at line 34 of file InnerBevel.cs.

Referenced by GetModifiedMaterial().

◆ m_NeedsToSetMaterialDirty

bool InnerBevel.m_NeedsToSetMaterialDirty
private

Definition at line 32 of file InnerBevel.cs.

Referenced by GetModifiedMaterial(), and Update().

◆ m_ShadowColor

Color InnerBevel.m_ShadowColor = Color.black

Definition at line 27 of file InnerBevel.cs.

◆ m_ShadowColorMode

ColorMode InnerBevel.m_ShadowColorMode
private

Definition at line 24 of file InnerBevel.cs.

◆ m_Verts

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

Definition at line 36 of file InnerBevel.cs.

Referenced by ModifyMesh().

Property Documentation

◆ bevelDirectionAndDepth

Vector2 InnerBevel.bevelDirectionAndDepth
getset

Definition at line 102 of file InnerBevel.cs.

103 {
104 get
105 {
107 }
108 set
109 {
110 if (!(m_BevelDirectionAndDepth == value))
111 {
113 if (base.graphic != null)
114 {
115 base.graphic.SetVerticesDirty();
116 }
117 }
118 }
119 }
Vector2 m_BevelDirectionAndDepth
Definition: InnerBevel.cs:30

Referenced by GetModifiedMaterial().

◆ highlightColor

Color InnerBevel.highlightColor
getset

Definition at line 54 of file InnerBevel.cs.

55 {
56 get
57 {
58 return m_HighlightColor;
59 }
60 set
61 {
62 m_HighlightColor = value;
63 if (base.graphic != null)
64 {
65 base.graphic.SetVerticesDirty();
66 }
67 }
68 }
Color m_HighlightColor
Definition: InnerBevel.cs:21

Referenced by GetModifiedMaterial().

◆ highlightColorMode

ColorMode InnerBevel.highlightColorMode
getset

Definition at line 38 of file InnerBevel.cs.

39 {
40 get
41 {
43 }
44 set
45 {
47 if (base.graphic != null)
48 {
49 base.graphic.SetVerticesDirty();
50 }
51 }
52 }
ColorMode m_HighlightColorMode
Definition: InnerBevel.cs:18

Referenced by GetModifiedMaterial().

◆ shadowColor

Color InnerBevel.shadowColor
getset

Definition at line 86 of file InnerBevel.cs.

87 {
88 get
89 {
90 return m_ShadowColor;
91 }
92 set
93 {
94 m_ShadowColor = value;
95 if (base.graphic != null)
96 {
97 base.graphic.SetVerticesDirty();
98 }
99 }
100 }
Color m_ShadowColor
Definition: InnerBevel.cs:27

Referenced by GetModifiedMaterial().

◆ shadowColorMode

ColorMode InnerBevel.shadowColorMode
getset

Definition at line 70 of file InnerBevel.cs.

71 {
72 get
73 {
74 return m_ShadowColorMode;
75 }
76 set
77 {
78 m_ShadowColorMode = value;
79 if (base.graphic != null)
80 {
81 base.graphic.SetVerticesDirty();
82 }
83 }
84 }
ColorMode m_ShadowColorMode
Definition: InnerBevel.cs:24

Referenced by GetModifiedMaterial().


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