protected override void ReadFromImpl(object obj) { base.ReadFromImpl(obj); Terrain uo = (Terrain)obj; terrainData = ToID(uo.terrainData); treeDistance = uo.treeDistance; treeBillboardDistance = uo.treeBillboardDistance; treeCrossFadeLength = uo.treeCrossFadeLength; treeMaximumFullLODCount = uo.treeMaximumFullLODCount; detailObjectDistance = uo.detailObjectDistance; detailObjectDensity = uo.detailObjectDensity; heightmapPixelError = uo.heightmapPixelError; heightmapMaximumLOD = uo.heightmapMaximumLOD; basemapDistance = uo.basemapDistance; lightmapIndex = uo.lightmapIndex; realtimeLightmapIndex = uo.realtimeLightmapIndex; lightmapScaleOffset = uo.lightmapScaleOffset; realtimeLightmapScaleOffset = uo.realtimeLightmapScaleOffset; freeUnusedRenderingResources = uo.freeUnusedRenderingResources; reflectionProbeUsage = uo.reflectionProbeUsage; materialTemplate = ToID(uo.materialTemplate); drawHeightmap = uo.drawHeightmap; drawTreesAndFoliage = uo.drawTreesAndFoliage; patchBoundsMultiplier = uo.patchBoundsMultiplier; treeLODBiasMultiplier = uo.treeLODBiasMultiplier; collectDetailPatches = uo.collectDetailPatches; editorRenderFlags = uo.editorRenderFlags; preserveTreePrototypeLayers = uo.preserveTreePrototypeLayers; allowAutoConnect = uo.allowAutoConnect; groupingID = uo.groupingID; drawInstanced = uo.drawInstanced; shadowCastingMode = uo.shadowCastingMode; }
public void BackTerrain(Terrain baseTerrain) { int nSize = (int)enumValue; CTerrainConfig.terrainsLong = nSize; CTerrainConfig.terrainsWide = nSize; TerrainData baseData = baseTerrain.terrainData; oldWidth = baseData.size.x; oldHeight = baseData.size.y; oldLenght = baseData.size.z; newWidth = oldWidth / CTerrainConfig.terrainsWide; newLength = oldLenght / CTerrainConfig.terrainsLong; xPos = baseTerrain.GetPosition().x; yPos = baseTerrain.GetPosition().y; zPos = baseTerrain.GetPosition().z; newHeightMapResolution = ((baseData.heightmapResolution - 1) / nSize) + 1; newEvenHeightMapResolution = newHeightMapResolution - 1; newDetailResolution = baseData.detailResolution / nSize; newAlphaMapResolution = baseData.alphamapResolution / nSize; newBaseMapResolution = baseData.baseMapResolution / nSize; treeDistance = baseTerrain.treeDistance; treeBillboardDistance = baseTerrain.treeBillboardDistance; treeCrossFadeLength = baseTerrain.treeCrossFadeLength; treeMaximumFullLODCount = baseTerrain.treeMaximumFullLODCount; detailObjectDistance = baseTerrain.detailObjectDistance; detailObjectDensity = baseTerrain.detailObjectDensity; heightmapPixelError = baseTerrain.heightmapPixelError; heightmapMaximumLOD = baseTerrain.heightmapMaximumLOD; basemapDistance = baseTerrain.basemapDistance; lightmapIndex = baseTerrain.lightmapIndex; castShadows = baseTerrain.castShadows; editorRenderFlags = baseTerrain.editorRenderFlags; splatProtos = baseData.splatPrototypes; detailProtos = baseData.detailPrototypes; treeProtos = baseData.treePrototypes; treeInst = baseData.treeInstances; grassStrength = baseData.wavingGrassStrength; grassAmount = baseData.wavingGrassAmount; grassSpeed = baseData.wavingGrassSpeed; grassTint = baseData.wavingGrassTint; }