Skip to content

Instantly share code, notes, and snippets.

@chengkehan
Created August 12, 2020 03:21
Show Gist options
  • Save chengkehan/4eef0cd0108996ccafc1f3f0f869ae65 to your computer and use it in GitHub Desktop.
Save chengkehan/4eef0cd0108996ccafc1f3f0f869ae65 to your computer and use it in GitHub Desktop.
// Convert tiling from UnityTerrain to CustomTerrain
material.SetTextureScale("_Splat0", new Vector2(1.0f / terrainLayer.tileSize.x * terrainData.size.x, 1.0f / terrainLayer.tileSize.y * terrainData.size.z))
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment