-
-
Save dotsquid/3c9fa0aeec30d8c77abdc8303dded40d to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
using UnityEngine; | |
using UnityEngine.UI; | |
namespace SC.Utilities | |
{ | |
public static class UIUtility | |
{ | |
public static void AddVertFull(this VertexHelper vh, UIVertex vert) => vh.AddVert(vert.position, vert.color, vert.uv0, vert.uv1, vert.uv2, vert.uv3, vert.normal, vert.tangent); | |
public static void AddUIVertexQuadFull(this VertexHelper vh, UIVertex[] verts) | |
{ | |
int startIndex = vh.currentVertCount; | |
vh.AddVertFull(verts[0]); | |
vh.AddVertFull(verts[1]); | |
vh.AddVertFull(verts[2]); | |
vh.AddVertFull(verts[3]); | |
vh.AddTriangle(startIndex, startIndex + 1, startIndex + 2); | |
vh.AddTriangle(startIndex + 2, startIndex + 3, startIndex); | |
} | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment