I wrote a short script to change the texture of the tree model during the game runing, but all the trees I drawn with the brush tool can not refresh automatically, I need to click "refresh trees and detail prototypes" under the terrain tab to refresh and see the result, so how can I refresh the data in the script?
Answer by duck
Jan 14, 2010 at 12:31 PM
There's a specific function to refresh the tree prototypes (and I'm you should also call Flush afterwards).
Also note, because these commands are undocumented, they may be changed or removed entirely in future versions of unity, so bear this in mind - particularly if you're targetting the webplayer.
Answer by jonas-echterhoff
Jan 14, 2010 at 11:56 AM
I think the undocumented method Terrain.Flush() should work for this.
Up to 2 attachments (including images) can be used with a maximum of 524.3 kB each and 1.0 MB total.
The best place to ask and answer questions about development with Unity.
To help users navigate the site we have posted a site navigation guide.
If you are a new user, check out our FAQ for more information.
If you are a moderator, see our Moderator Guidelines page.
We are making improvements to UA, see the list of changes.
Answers and Comments
No one has followed this question yet.
Remove Trees during runtime
What is the difference with TerrainDetails?
Initial rotation of trees with a script
Rim Lighting on Terrain?