hi all
I’d like to know how to adjust these X and Y size parameters from a script, at runtime:
I’m also interested in any information/opinions/techniques/anecdotes regarding doing this, and any information about the performance costs.
hi all
I’d like to know how to adjust these X and Y size parameters from a script, at runtime:
I’m also interested in any information/opinions/techniques/anecdotes regarding doing this, and any information about the performance costs.
This example changes all x,y Terrain map tileSizes to 100
Terrain terrain=GetComponent<Terrain>();
float newTileSize=100f;
SplatPrototype[] splats=new SplatPrototype[terrain.terrainData.splatPrototypes.Length];
for(int i=0;i<terrain.terrainData.splatPrototypes.Length;i++){
SplatPrototype splat=terrain.terrainData.splatPrototypes*;*
_ splats = new SplatPrototype();_
_ splats*.texture = splat.texture;
splats.tileOffset = splat.tileOffset;
splats.tileSize = new Vector2(newTileSize, newTileSize);
splats.texture.Apply(true);
}*
terrain.terrainData.splatPrototypes=splats;
Happy Terrain Coding! =oD
Martian Games_