コード例 #1
0
 private void Awake()
 {
     meshCollider     = GetComponent <MeshCollider>();
     landformRenderer = GetComponent <LandformChunkRenderer>();
     collisionMesh    = meshCollider.sharedMesh = CreateMesh();
     landformRenderer.OnHeightChanged += UpdateMesh;
 }
コード例 #2
0
 private void UpdateMesh(LandformChunkRenderer renderer)
 {
     if (collisionMesh == null)
     {
         collisionMesh = meshCollider.sharedMesh = CreateMesh();
     }
     else
     {
         UpdateMesh(ref collisionMesh);
         meshCollider.sharedMesh = collisionMesh;
     }
 }