using UnityEngine;
using System.Collections;
public class MeshTest : MonoBehaviour {
private MeshFilter m_MeshFilter;
void Start () {
Mesh mesh = new Mesh();
mesh.vertices = new Vector3[] {
new Vector3(0, 0, 0),
new Vector3(1, 0, 0),
new Vector3(1, 1, 0),
new Vector3(0, 1, 0)
};
mesh.triangles = new int[] {
0, 3, 1,
1, 3, 2,
};
mesh.uv = new Vector2[] {
new Vector2(0, 0),
new Vector2(1, 0),
new Vector2(1, 1),
new Vector2(0, 1)
};
m_MeshFilter = GetComponent<MeshFilter>();
m_MeshFilter.mesh = mesh;
}
}