本文整理汇总了C#中UnityEngine.GetUIVertexStream方法的典型用法代码示例。如果您正苦于以下问题:C# UnityEngine.GetUIVertexStream方法的具体用法?C# UnityEngine.GetUIVertexStream怎么用?C# UnityEngine.GetUIVertexStream使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类UnityEngine
的用法示例。
在下文中一共展示了UnityEngine.GetUIVertexStream方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: OnPopulateMesh
protected override void OnPopulateMesh(UnityEngine.UI.VertexHelper toFill)
{
base.OnPopulateMesh (toFill);
var rect = parentRectTransform.rect;
var vertices = new List<UIVertex> (4);
toFill.GetUIVertexStream (vertices);
for (var i = 0; i < points.Length; i++) {
var point = points [i];
var ray = gameCamera.ViewportPointToRay (point);
RaycastHit hit;
if (Physics.Raycast (ray, out hit, gameCamera.farClipPlane, groundLayer)) {
var transformedPosition = minimapCamera.WorldToViewportPoint (hit.point);
// if (vertices.Count == 36) {
// foreach (var j in correspondences[i]) {
// var vertex = vertices [j].position;
// vertex.x = vertex.x * transformedPosition.x;
// vertex.y = vertex.y * transformedPosition.y;
// vertices [j].position = vertex;
// }
// } else {
var vboPoint = vertices [i].position;
vboPoint = new Vector3 (transformedPosition.x * rect.width, transformedPosition.y * rect.height, 0f);
var uiPoint = vertices [i];
uiPoint.position = vboPoint;
vertices [i] = uiPoint;
toFill.SetUIVertex (vertices [i], i);
// }
}
}
}