本文整理汇总了C#中UnityEngine.UI.VertexHelper.SetUIVertex方法的典型用法代码示例。如果您正苦于以下问题:C# VertexHelper.SetUIVertex方法的具体用法?C# VertexHelper.SetUIVertex怎么用?C# VertexHelper.SetUIVertex使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类UnityEngine.UI.VertexHelper
的用法示例。
在下文中一共展示了VertexHelper.SetUIVertex方法的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: ModifyMesh
public override void ModifyMesh(VertexHelper helper)
{
if (!IsActive() || helper.currentVertCount == 0)
return;
List<UIVertex> vertices = new List<UIVertex>();
helper.GetUIVertexStream(vertices);
float bottomY = vertices[0].position.y;
float topY = vertices[0].position.y;
for (int i = 1; i < vertices.Count; i++)
{
float y = vertices[i].position.y;
if (y > topY)
{
topY = y;
}
else if (y < bottomY)
{
bottomY = y;
}
}
float uiElementHeight = topY - bottomY;
UIVertex v = new UIVertex();
for (int i = 0; i < helper.currentVertCount; i++)
{
helper.PopulateUIVertex(ref v, i);
v.color = Color32.Lerp(bottomColor, topColor, (v.position.y - bottomY) / uiElementHeight);
helper.SetUIVertex(v, i);
}
}
示例2: ModifyMesh
public override void ModifyMesh(VertexHelper vh)
{
UIVertex vertex = new UIVertex();
for (int i = 0; i < vh.currentVertCount; i++)
{
vh.PopulateUIVertex(ref vertex, i);
vertex.uv1 = new Vector2(vertex.position.x, vertex.position.y);
vh.SetUIVertex(vertex, i);
}
}
示例3: ModifyMesh
public override void ModifyMesh(VertexHelper vh)
{
if (!IsActive())
return;
UIVertex vert = new UIVertex();
for (int i = 0; i < vh.currentVertCount; i++)
{
vh.PopulateUIVertex(ref vert, i);
vert.uv1.x = (i >> 1);
vert.uv1.y = ((i >> 1) ^ (i & 1));
vh.SetUIVertex(vert, i);
}
}
示例4: ModifyMesh
public override void ModifyMesh (VertexHelper vh)
{
if (!this.IsActive())
return;
List<UIVertex> list = new List<UIVertex>();
vh.GetUIVertexStream(list);
ModifyVertices(list); // calls the old ModifyVertices which was used on pre 5.2
for (int i = 0; i < list.Count; ++i) {
vh.SetUIVertex (list [i], i);
}
}
示例5: ModifyMesh
public override void ModifyMesh(VertexHelper helper)
{
for (int i = 0; i < helper.currentVertCount; i++)
{
UIVertex vert = new UIVertex();
helper.PopulateUIVertex(ref vert, i);
if (currentChar < 0)
{
vert.color = Color.clear;
}
else
{
if (i / 4 > currentChar)
{
vert.color = Color.clear;
}
}
helper.SetUIVertex(vert, i);
}
}