当前位置: 首页>>代码示例>>C#>>正文


C# VertexHelper.SetUIVertex方法代码示例

本文整理汇总了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);
         }
    }
开发者ID:l980305284,项目名称:UGUIPlugin,代码行数:35,代码来源:Gradient.cs

示例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);
     }
 }
开发者ID:CarlosHBC,项目名称:UnityDecompiled,代码行数:10,代码来源:PositionAsUV1.cs

示例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);
        }
    }
开发者ID:bluesky7290,项目名称:uGUISpriteInAtlasShader,代码行数:14,代码来源:VertIndexAsUV1.cs

示例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);
		}
	}
开发者ID:RandomTiger,项目名称:gvr-unity-sdk,代码行数:14,代码来源:TessellationVertexEffect.cs

示例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);
            }
        }
开发者ID:CarlosMeloStuff,项目名称:Monologue,代码行数:22,代码来源:Monologue.cs


注:本文中的UnityEngine.UI.VertexHelper.SetUIVertex方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。