예제 #1
0
        protected void OnValidate()
        {
            MeshFilter.sharedMesh = PlaneCreation.GetMeshFromHeightmap(_heightmap, _gridDelta);

            var mesh = MeshFilter.sharedMesh;

            if (mesh != null && _heightmap != null)
            {
                float heightScale = Mathf.Min(_heightmap.width, _heightmap.height) * 0.5f;
                PlaneCreation.SetMeshVertexHeights(mesh, _heightmap, heightScale);
            }
        }
 protected override Mesh GetMeshFromHeightmap(Texture heightmap, Vector3 gridDelta)
 {
     return(PlaneCreation.GetMeshFromHeightmap(heightmap, gridDelta));
 }