/// <summary> /// Clone Constructor /// </summary> /// <param name="lbTerrainTree"></param> public LBTerrainTree(LBTerrainTree lbTerrainTree) { this.maxTreesPerSqrKm = lbTerrainTree.maxTreesPerSqrKm; this.bendFactor = lbTerrainTree.bendFactor; this.prefab = lbTerrainTree.prefab; this.minScale = lbTerrainTree.minScale; this.maxScale = lbTerrainTree.maxScale; this.treeScalingMode = lbTerrainTree.treeScalingMode; this.lockWidthToHeight = lbTerrainTree.lockWidthToHeight; this.minProximity = lbTerrainTree.minProximity; this.minHeight = lbTerrainTree.minHeight; this.maxHeight = lbTerrainTree.maxHeight; this.minInclination = lbTerrainTree.minInclination; this.maxInclination = lbTerrainTree.maxInclination; this.treePlacingMode = lbTerrainTree.treePlacingMode; this.isCurvatureConcave = lbTerrainTree.isCurvatureConcave; this.curvatureDistance = lbTerrainTree.curvatureDistance; this.curvatureMinHeightDiff = lbTerrainTree.curvatureMinHeightDiff; this.map = lbTerrainTree.map; this.mapColour = lbTerrainTree.mapColour; this.mapTolerance = lbTerrainTree.mapTolerance; this.mapInverse = lbTerrainTree.mapInverse; this.useNoise = lbTerrainTree.useNoise; this.noiseTileSize = lbTerrainTree.noiseTileSize; this.noiseOffset = lbTerrainTree.noiseOffset; this.treePlacementCutoff = lbTerrainTree.treePlacementCutoff; this.mapToleranceBlendCurve = lbTerrainTree.mapToleranceBlendCurve; this.mapIsPath = lbTerrainTree.mapIsPath; this.isDisabled = lbTerrainTree.isDisabled; this.offsetY = lbTerrainTree.offsetY; this.showTree = lbTerrainTree.showTree; if (lbTerrainTree.filterList != null) { this.filterList = LBFilter.CopyList(lbTerrainTree.filterList); } else { this.filterList = new List <LBFilter>(); } this.isTinted = lbTerrainTree.isTinted; this.maxTintStrength = lbTerrainTree.maxTintStrength; this.tintColour = lbTerrainTree.tintColour; if (lbTerrainTree.lbTerrainDataList == null) { this.lbTerrainDataList = null; } else { this.lbTerrainDataList = new List <LBTerrainData>(lbTerrainTree.lbTerrainDataList); } if (lbTerrainTree.prefabName == null) { this.prefabName = string.Empty; } else { this.prefabName = lbTerrainTree.prefabName; } this.showPrefabPreview = lbTerrainTree.showPrefabPreview; this.GUID = lbTerrainTree.GUID; }
// Class constructor public LBTerrainTree() { // Added v1.3.1 Beta 3b this.maxTreesPerSqrKm = 250; this.bendFactor = 0.5f; this.prefab = null; this.minScale = 0.8f; this.maxScale = 1.2f; this.treeScalingMode = TreeScalingMode.RandomScaling; this.lockWidthToHeight = true; this.minProximity = 25f; this.minHeight = 0.5f; this.maxHeight = 0.75f; this.minInclination = 0f; this.maxInclination = 30f; this.treePlacingMode = TreePlacingMode.HeightAndInclination; // Added v2.0.7 Beta 5 this.isCurvatureConcave = false; this.curvatureMinHeightDiff = 1f; this.curvatureDistance = 5f; // Added v1.1 Beta 7 this.map = null; this.mapColour = UnityEngine.Color.white; this.mapTolerance = 1; this.mapInverse = false; this.useNoise = true; this.noiseTileSize = 500f; // Noise offset cannot be modified from the editor as it is randomly set when the terrain is populated with trees this.treePlacementCutoff = 0.65f; // Added 1.3.2 Beta 7b this.mapToleranceBlendCurve = LBMap.GetDefaultToleranceBlendCurve; this.mapIsPath = false; // Added 1.3.5 Beta 5a this.offsetY = 0f; // Added v1.2.1 this.isDisabled = false; // Added v1.3.0 Beta 3 this.showTree = true; // Added v1.4.0 Beta 5b this.isTinted = true; this.maxTintStrength = 0.2f; this.tintColour = Color.green; // Added v1.4.2 Beta 3a this.lbTerrainDataList = null; // Added v1.4.2 Beta 6d this.prefabName = string.Empty; // Added v2.0.7 Beta 4a this.showPrefabPreview = false; // Added v2.0.2 // Assign a unique identifier GUID = System.Guid.NewGuid().ToString(); }