Last active
September 21, 2017 04:24
-
-
Save TakashiYoshinaga/21c11ddcf2e45005babd31ee30661707 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
//もともとあったコード。m_meshに頂点情報(座標と順番)や色情報を渡している | |
m_mesh.Clear(); | |
m_mesh.SetVertices(m_meshVertices); | |
m_mesh.SetIndices(m_meshIndices.ToArray(), MeshTopology.Triangles, 0); | |
m_mesh.SetColors(m_meshColors); | |
//下記の2行を新たに追加。上記で作成した三角形の集合をコライダーに反映 | |
//Add following 2 lines. This cord attaches triangular mesh information to collider. | |
GetComponent<MeshCollider>().sharedMesh = null; | |
GetComponent<MeshCollider>().sharedMesh = m_mesh; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment