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.5f, 1, 0),
new Vector3(0.6f, 1.5f, 0),
new Vector3(-0.8f, 1, 0),
};
mesh.triangles = new int[] {
0, 2, 1,
0, 4, 2,
4, 3, 2,
};
m_MeshFilter = GetComponent<MeshFilter>();
m_MeshFilter.mesh = mesh;
}
}