Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 4 additions & 2 deletions Runtime/Scripts/Effects/Gradient2.cs
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@ public class Gradient2 : BaseMeshEffect
[SerializeField]
[Tooltip("Add vertices to display complex gradients. Turn off if your shape is already very complex, like text.")]
bool _modifyVertices = true;
Color _baseVertexColor;

[SerializeField]
[Range(-1, 1)]
Expand Down Expand Up @@ -111,6 +112,7 @@ public override void ModifyMesh(VertexHelper helper)
List<UIVertex> _vertexList = ListPool<UIVertex>.Get();

helper.GetUIVertexStream(_vertexList);
_baseVertexColor = _vertexList[0].color;

int nCount = _vertexList.Count;
switch (GradientType)
Expand Down Expand Up @@ -510,7 +512,7 @@ UIVertex CreateSplitVertex(UIVertex vertex1, UIVertex vertex2, float stop)
splitVertex.position = new Vector3(stop, splitY, vertex1.position.z);
splitVertex.normal = vertex1.normal;
splitVertex.uv0 = new Vector2(vertex1.uv0.x - (uvx * ratio), vertex1.uv0.y - (uvy * ratio));
splitVertex.color = Color.white;
splitVertex.color = _baseVertexColor;
return splitVertex;
}
else
Expand All @@ -527,7 +529,7 @@ UIVertex CreateSplitVertex(UIVertex vertex1, UIVertex vertex2, float stop)
splitVertex.position = new Vector3(splitX, stop, vertex1.position.z);
splitVertex.normal = vertex1.normal;
splitVertex.uv0 = new Vector2(vertex1.uv0.x - (uvx * ratio), vertex1.uv0.y - (uvy * ratio));
splitVertex.color = Color.white;
splitVertex.color = _baseVertexColor;
return splitVertex;
}
}
Expand Down
Loading