31. Graphics.DrawMesh
公式リファレンスより
Use DrawMesh in situations where you want to draw
large amount of meshes, but don't want the
overhead of creating and managing game objects.
メッシュの数が多くても、ゲームオブジェクトの管理
が楽になる、ということらしい
34. Graphics.DrawMeshNow
? UpdateじゃなくてOnPostRenderで呼ぶ
? MaterialのPassの設定が必要 (普通は0)
public Mesh mesh;
public Material mat;
public void OnPostRender() {
// set first shader pass of the material
mat.SetPass(0);
// draw mesh at the origin
Graphics.DrawMeshNow(mesh, Vector3.zero, Quaternion.identity);
}
38. Mesh.CombineMeshes
var combine = new CombineInstance[10];
for (int i = 0; i < combine.Length; i++){
combine[i].mesh =meshes[i];
}
//このメッシュにすべての他のメッシュをまとめる
mesh.CombineMeshes(combine);