private void ApplyTexture(Heightmap heightmap) { heightmap.Normalize(); _texture = HeightmapConverter.ToTexture2D(heightmap); var rect = new Rect(0, 0, _texture.width, _texture.height); _image.sprite = Sprite.Create(_texture, rect, Vector2.one * 0.5f); _image.SetNativeSize(); }
public Heightmap Convert(IExportContainer container) { return(HeightmapConverter.Convert(container, ref this)); }
private void GenerateMesh(Heightmap heightmap) { var terrainMesh = HeightmapConverter.ToMesh(heightmap); _terrainMeshFilter.mesh = terrainMesh; }
private void UpdateSprite() { UpdateClone(); _image.sprite = HeightmapConverter.ToSprite(HeightmapModified); }