1using System.Collections.Generic;
5[AddComponentMenu(
"UI/Effects/GradientEffect")]
36 List<UIVertex> list =
new List<UIVertex>();
37 vh.GetUIVertexStream(list);
40 vh.AddUIVertexTriangleStream(list);
46 if (!IsActive() || vertexList.Count == 0)
50 int count = vertexList.Count;
51 UIVertex uIVertex = vertexList[0];
58 float num = ((
gradientDir ==
GradientDir.Vertical) ? vertexList[vertexList.Count - 1].position.y : vertexList[vertexList.Count - 1].position.x);
59 float num2 = ((
gradientDir ==
GradientDir.Vertical) ? vertexList[0].position.y : vertexList[0].position.x) - num;
60 for (
int i = 0; i < count; i++)
62 uIVertex = vertexList[i];
65 ref Color32 color = ref uIVertex.color;
67 vertexList[i] = uIVertex;
72 for (
int j = 0; j < count; j++)
74 uIVertex = vertexList[j];
81 ref Color32 color4 = ref uIVertex.color;
87 ref Color32 color5 = ref uIVertex.color;
93 ref Color32 color3 = ref uIVertex.color;
99 ref Color32 color2 = ref uIVertex.color;
104 vertexList[j] = uIVertex;
111 if (Mathf.Abs(col1.r - col2.r) < 0.003f && Mathf.Abs(col1.g - col2.g) < 0.003f && Mathf.Abs(col1.b - col2.b) < 0.003f && Mathf.Abs(col1.a - col2.a) < 0.003f)
GradientMode gradientMode
override void ModifyMesh(VertexHelper vh)
bool CompareCarefully(Color col1, Color col2)
void ModifyVertices(List< UIVertex > vertexList)