@@ -31,16 +31,6 @@ protected void DrawSprite(Vector2Int position, Vector2Int size, Texture texture,
3131 vertices [ 3 ] . position = new ( size . X , size . Y , 0 ) ;
3232 vertices [ 3 ] . uv = new ( 1 , 1 ) ;
3333
34- /*
35- var vertexBuffer = VertexBuffer.CreateTransient(vertices.AsSpan(), SpriteUtils.VertexLayout.Value);
36-
37- var indexBuffer = IndexBuffer.CreateTransient(indices);
38-
39- if (vertexBuffer == null || indexBuffer == null)
40- {
41- return;
42- }
43-
4434 var c = material . MainColor ;
4535 var t = material . MainTexture ;
4636
@@ -50,13 +40,11 @@ protected void DrawSprite(Vector2Int position, Vector2Int size, Texture texture,
5040 material . DisableShaderKeyword ( Shader . SkinningKeyword ) ;
5141 material . DisableShaderKeyword ( Shader . InstancingKeyword ) ;
5242
53- Graphics.RenderGeometry(vertexBuffer, indexBuffer, 0, 4, 0, 6, material, Vector3.Zero,
54- Matrix4x4.CreateTranslation(new Vector3(position.X, position.Y, 0)), MeshTopology.Triangles, MaterialLighting.Unlit,
55- Manager.ViewID);
43+ Graphics . RenderSimple ( vertices , SpriteUtils . VertexLayout . Value , indices , material , Vector3 . Zero ,
44+ Matrix4x4 . CreateTranslation ( new Vector3 ( position . X , position . Y , 0 ) ) , MeshTopology . Triangles , MaterialLighting . Unlit ) ;
5645
5746 material . MainColor = c ;
5847 material . MainTexture = t ;
59- */
6048 }
6149
6250 /// <summary>
@@ -85,16 +73,6 @@ protected void DrawSprite(Vector2Int position, Vector2Int size, Texture texture,
8573 vertices [ 3 ] . position = new ( size . X , size . Y , 0 ) ;
8674 vertices [ 3 ] . uv = new ( rect . right / ( float ) texture . Width , rect . bottom / ( float ) texture . Height ) ;
8775
88- /*
89- var vertexBuffer = VertexBuffer.CreateTransient(vertices.AsSpan(), SpriteUtils.VertexLayout.Value);
90-
91- var indexBuffer = IndexBuffer.CreateTransient(indices);
92-
93- if (vertexBuffer == null || indexBuffer == null)
94- {
95- return;
96- }
97-
9876 var c = material . MainColor ;
9977 var t = material . MainTexture ;
10078
@@ -104,13 +82,11 @@ protected void DrawSprite(Vector2Int position, Vector2Int size, Texture texture,
10482 material . DisableShaderKeyword ( Shader . SkinningKeyword ) ;
10583 material . DisableShaderKeyword ( Shader . InstancingKeyword ) ;
10684
107- Graphics.RenderGeometry(vertexBuffer, indexBuffer, 0, 4, 0, 6, material, Vector3.Zero,
108- Matrix4x4.CreateTranslation(new Vector3(position.X, position.Y, 0)), MeshTopology.Triangles, MaterialLighting.Unlit,
109- Manager.ViewID);
85+ Graphics . RenderSimple ( vertices , SpriteUtils . VertexLayout . Value , indices , material , Vector3 . Zero ,
86+ Matrix4x4 . CreateTranslation ( new Vector3 ( position . X , position . Y , 0 ) ) , MeshTopology . Triangles , MaterialLighting . Unlit ) ;
11087
11188 material . MainColor = c ;
11289 material . MainTexture = t ;
113- */
11490 }
11591
11692 /// <summary>
@@ -147,14 +123,10 @@ protected void DrawSpriteSliced(Vector2Int position, Vector2Int size, Texture te
147123 var vertexBuffer = VertexBuffer.CreateTransient(ninePatchVertices.AsSpan(), SpriteUtils.VertexLayout.Value);
148124
149125 var indexBuffer = IndexBuffer.CreateTransient(ninePatchIndices);
126+ */
150127
151128 material ??= new ( SpriteUtils . DefaultMaterial . Value ) ;
152129
153- if (vertexBuffer == null || indexBuffer == null)
154- {
155- return;
156- }
157-
158130 var c = material . MainColor ;
159131 var t = material . MainTexture ;
160132
@@ -164,13 +136,11 @@ protected void DrawSpriteSliced(Vector2Int position, Vector2Int size, Texture te
164136 material . DisableShaderKeyword ( Shader . SkinningKeyword ) ;
165137 material . DisableShaderKeyword ( Shader . InstancingKeyword ) ;
166138
167- Graphics.RenderGeometry(vertexBuffer, indexBuffer, 0, ninePatchVertices.Length, 0, ninePatchIndices.Length, material, Vector3.Zero,
168- Matrix4x4.CreateTranslation(new Vector3(position.X, position.Y, 0)), MeshTopology.Triangles, MaterialLighting.Unlit,
169- Manager.ViewID);
139+ Graphics . RenderSimple ( ninePatchVertices , SpriteUtils . VertexLayout . Value , ninePatchIndices , material , Vector3 . Zero ,
140+ Matrix4x4 . CreateTranslation ( new Vector3 ( position . X , position . Y , 0 ) ) , MeshTopology . Triangles , MaterialLighting . Unlit ) ;
170141
171142 material . MainColor = c ;
172143 material . MainTexture = t ;
173- */
174144 }
175145
176146 /// <summary>
@@ -225,15 +195,9 @@ protected void RenderText(string str, TextParameters parameters)
225195 return ;
226196 }
227197
228- /*
229- var vertexBuffer = VertexBuffer.CreateTransient(textVertices.AsSpan(), TextRenderer.VertexLayout.Value);
230-
231- var indexBuffer = IndexBuffer.CreateTransient(textIndices);
232-
233198 material . MainTexture = texture ;
234199
235- Graphics.RenderGeometry(vertexBuffer, indexBuffer, 0, vertexCount, 0, indexCount, material, Vector3.Zero,
236- Matrix4x4.Identity, MeshTopology.Triangles, MaterialLighting.Unlit, Manager.ViewID);
237- */
200+ Graphics . RenderSimple ( textVertices , TextRenderer . VertexLayout . Value , textIndices , material , Vector3 . Zero ,
201+ Matrix4x4 . Identity , MeshTopology . Triangles , MaterialLighting . Unlit ) ;
238202 }
239203}
0 commit comments