-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathMeshCreator.cs
More file actions
53 lines (49 loc) · 1.2 KB
/
MeshCreator.cs
File metadata and controls
53 lines (49 loc) · 1.2 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
using UnityEngine;
namespace TextureFlow
{
static class MeshCreator
{
public static Mesh Quad
{
get
{
if (!_quad)
_quad = GetQuad(new Color(0, 0, 0, 0));
return _quad;
}
}
private static Mesh _quad;
public static Mesh GetQuad(Color color)
{
//0 - 1
//| \ |
//2 - 3
return new Mesh
{
vertices = new Vector3[]
{
new Vector3(0,0),
new Vector3(0,1),
new Vector3(1,0),
new Vector3(1,1),
},
uv = new Vector2[]
{
new Vector2(0,0),
new Vector2(0,1),
new Vector2(1,0),
new Vector2(1,1),
},
colors = new Color[]
{
color, color, color, color,
},
triangles = new int[]
{
0,1,3,
3,2,0,
},
};
}
}
}