MassPlaceTrees() public static method

public static MassPlaceTrees ( TerrainData terrainData, int numberOfTrees, bool randomTreeColor, bool keepExistingTrees ) : void
terrainData UnityEngine.TerrainData
numberOfTrees int
randomTreeColor bool
keepExistingTrees bool
return void
 void OnWizardCreate()
 {
     if (numberOfTrees > kMaxNumberOfTrees)
     {
         isValid     = false;
         errorString = String.Format("Mass placing more than {0} trees is not supported", kMaxNumberOfTrees);
         Debug.LogError(errorString);
         return;
     }
     TreePainter.MassPlaceTrees(m_Terrain.terrainData, numberOfTrees, true, keepExistingTrees);
     m_Terrain.Flush();
 }
示例#2
0
 private void OnWizardCreate()
 {
     if (this.numberOfTrees > 1000000)
     {
         base.isValid     = false;
         base.errorString = string.Format("Mass placing more than {0} trees is not supported", 1000000);
         Debug.LogError(base.errorString);
         return;
     }
     TreePainter.MassPlaceTrees(this.m_Terrain.terrainData, this.numberOfTrees, true, this.keepExistingTrees);
     this.m_Terrain.Flush();
 }
 private void OnWizardCreate()
 {
     if (this.numberOfTrees > 0xf4240)
     {
         base.isValid     = false;
         base.errorString = $"Mass placing more than {0xf4240} trees is not supported";
         Debug.LogError(base.errorString);
     }
     else
     {
         TreePainter.MassPlaceTrees(base.m_Terrain.terrainData, this.numberOfTrees, true, this.keepExistingTrees);
         base.m_Terrain.Flush();
     }
 }