/// <summary> /// Constructor for cloning a layer /// </summary> /// <param name="lbLandscapeMesh"></param> public LBLandscapeMesh(LBLandscapeMesh lbLandscapeMesh) { this.mesh = lbLandscapeMesh.mesh; this.materials = new List <Material>(lbLandscapeMesh.materials); this.offset = lbLandscapeMesh.offset; this.maxMeshes = lbLandscapeMesh.maxMeshes; this.minProximity = lbLandscapeMesh.minProximity; this.randomiseYRotation = lbLandscapeMesh.randomiseYRotation; this.fixedYRotation = lbLandscapeMesh.fixedYRotation; this.XRotation = lbLandscapeMesh.XRotation; this.ZRotation = lbLandscapeMesh.ZRotation; this.isTerrainAligned = lbLandscapeMesh.isTerrainAligned; this.minScale = lbLandscapeMesh.minScale; this.maxScale = lbLandscapeMesh.maxScale; this.minHeight = lbLandscapeMesh.minHeight; this.maxHeight = lbLandscapeMesh.maxHeight; this.minInclination = lbLandscapeMesh.minInclination; this.maxInclination = lbLandscapeMesh.maxInclination; this.meshPlacingMode = lbLandscapeMesh.meshPlacingMode; this.map = lbLandscapeMesh.map; this.mapColour = lbLandscapeMesh.mapColour; this.mapTolerance = lbLandscapeMesh.mapTolerance; this.mapToleranceBlendCurve = new AnimationCurve(lbLandscapeMesh.mapToleranceBlendCurve.keys); this.mapIsPath = lbLandscapeMesh.mapIsPath; this.useNoise = lbLandscapeMesh.useNoise; this.noiseTileSize = lbLandscapeMesh.noiseTileSize; this.noiseOffset = lbLandscapeMesh.noiseOffset; this.meshPlacementCutoff = lbLandscapeMesh.meshPlacementCutoff; this.isClustered = lbLandscapeMesh.isClustered; this.clusterDistance = lbLandscapeMesh.clusterDistance; this.clusterDensity = lbLandscapeMesh.clusterDensity; this.clusterResolution = lbLandscapeMesh.clusterResolution; this.removeGrass = lbLandscapeMesh.removeGrass; this.minGrassProximity = lbLandscapeMesh.minGrassProximity; this.showMesh = lbLandscapeMesh.showMesh; this.isDisabled = lbLandscapeMesh.isDisabled; this.usePrefab = lbLandscapeMesh.usePrefab; this.prefab = lbLandscapeMesh.prefab; this.isCombineMesh = lbLandscapeMesh.isCombineMesh; this.isCreateCollider = lbLandscapeMesh.isCreateCollider; this.isRemoveEmptyGameObjects = lbLandscapeMesh.isRemoveEmptyGameObjects; this.minTreeProximity = lbLandscapeMesh.minTreeProximity; this.isTerrainFlattened = lbLandscapeMesh.isTerrainFlattened; this.flattenDistance = lbLandscapeMesh.flattenDistance; this.flattenBlendRate = lbLandscapeMesh.flattenBlendRate; this.flattenHeightOffset = lbLandscapeMesh.flattenHeightOffset; if (lbLandscapeMesh.filterList != null) { this.filterList = LBFilter.CopyList(lbLandscapeMesh.filterList); } else { this.filterList = new List <LBFilter>(); } this.isKeepPrefabConnection = lbLandscapeMesh.isKeepPrefabConnection; if (lbLandscapeMesh.prefabName == null) { this.prefabName = string.Empty; } else { this.prefabName = lbLandscapeMesh.prefabName; } }
// Class Constructor public LBLandscapeMesh() { this.mesh = null; this.materials = new List <Material>(); this.offset = Vector3.zero; // When usePrefab is false, combine mesh is always true this.isCombineMesh = true; this.isCreateCollider = false; this.isRemoveEmptyGameObjects = true; this.maxMeshes = 100; this.minProximity = 10f; this.randomiseYRotation = true; this.fixedYRotation = 0f; this.XRotation = 0f; this.ZRotation = 0f; this.isTerrainAligned = false; this.minScale = 1f; this.maxScale = 3f; this.minHeight = 0.55f; this.maxHeight = 0.75f; this.minInclination = 0f; this.maxInclination = 30f; this.meshPlacingMode = MeshPlacingMode.Height; // Added v1.1 Beta 8 this.map = null; this.mapColour = UnityEngine.Color.blue; this.mapTolerance = 1; // Added v1.3.2 Beta 7b this.mapToleranceBlendCurve = LBMap.GetDefaultToleranceBlendCurve; this.mapIsPath = false; // Added v1.3.1 beta 8e this.useNoise = false; this.noiseTileSize = 500f; // Noise offset cannot be modified from the editor as it is randomly set when the terrain // is populated with meshes or prefabs this.meshPlacementCutoff = 0.65f; // Added v1.3.5 Beta 1d this.isClustered = false; this.clusterDistance = 5f; this.clusterDensity = 0.5f; this.clusterResolution = 1f; // Added v1.2 Beta 12 this.removeGrass = true; this.minGrassProximity = 2f; // Added v1.3.0 this.showMesh = true; this.isDisabled = false; // Added v1.3.1 Beta 8c this.usePrefab = false; this.prefab = null; // Added v1.3.1. Beta 9g this.minTreeProximity = this.minProximity; // Added v1.3.5 Beta 1b this.isTerrainFlattened = false; this.flattenDistance = 2f; this.flattenBlendRate = 0.5f; this.flattenHeightOffset = 0f; // Added v1.4.2 Beta 6b this.isKeepPrefabConnection = false; // Added v1.4.2 Beta 6f this.prefabName = string.Empty; }