Version: 2017.2

Terrain

class in UnityEngine

/

다음으로부터 상속:Behaviour

매뉴얼로 전환

설명

The Terrain component renders the terrain.

정적 변수

activeTerrainThe active terrain. This is a convenience function to get to the main terrain in the scene.
activeTerrainsThe active terrains in the scene.

변수

bakeLightProbesForTreesSpecifies if an array of internal light probes should be baked for terrain trees. Available only in editor.
basemapDistanceHeightmap patches beyond basemap distance will use a precomputed low res basemap.
castShadowsShould terrain cast shadows?.
collectDetailPatchesCollect detail patches from memory.
detailObjectDensityDensity of detail objects.
detailObjectDistanceDetail objects will be displayed up to this distance.
drawHeightmapSpecify if terrain heightmap should be drawn.
drawTreesAndFoliageSpecify if terrain trees and details should be drawn.
editorRenderFlagsControls what part of the terrain should be rendered.
freeUnusedRenderingResourcesWhether some per-camera rendering resources for the terrain should be freed after not being used for some frames.
heightmapMaximumLODLets you essentially lower the heightmap resolution used for rendering.
heightmapPixelErrorAn approximation of how many pixels the terrain will pop in the worst case when switching lod.
legacyShininessThe shininess value of the terrain.
legacySpecularThe specular color of the terrain.
lightmapIndexThe index of the baked lightmap applied to this terrain.
lightmapScaleOffsetThe UV scale & offset used for a baked lightmap.
materialTemplateThe custom material used to render the terrain.
materialTypeThe type of the material used to render the terrain. Could be one of the built-in types or custom. See MaterialType.
patchBoundsMultiplierSet the terrain bounding box scale.
realtimeLightmapIndexThe index of the realtime lightmap applied to this terrain.
realtimeLightmapScaleOffsetThe UV scale & offset used for a realtime lightmap.
reflectionProbeUsageHow reflection probes are used for terrain. See ReflectionProbeUsage.
terrainDataThe Terrain Data that stores heightmaps, terrain textures, detail meshes and trees.
treeBillboardDistanceDistance from the camera where trees will be rendered as billboards only.
treeCrossFadeLengthTotal distance delta that trees will use to transition from billboard orientation to mesh orientation.
treeDistanceThe maximum distance at which trees are rendered.
treeLODBiasMultiplierThe multiplier to the current LOD bias used for rendering LOD trees (i.e. SpeedTree trees).
treeMaximumFullLODCountMaximum number of trees rendered at full LOD.

Public 함수

AddTreeInstanceAdds a tree instance to the terrain.
ApplyDelayedHeightmapModificationUpdate the terrain's LOD and vegetation information after making changes with TerrainData.SetHeightsDelayLOD.
FlushFlushes any change done in the terrain so it takes effect.
GetClosestReflectionProbesFills the list with reflection probes whose AABB intersects with terrain's AABB. Their weights are also provided. Weight shows how much influence the probe has on the terrain, and is used when the blending between multiple reflection probes occurs.
GetPositionGet the position of the terrain.
GetSplatMaterialPropertyBlockGet the previously set splat material properties by copying to the dest MaterialPropertyBlock object.
SampleHeightSamples the height at the given position defined in world space, relative to the terrain space.
SetNeighborsLets you setup the connection between neighboring Terrains.
SetSplatMaterialPropertyBlockSet the additional material properties when rendering the terrain heightmap using the splat material.

정적 함수

CreateTerrainGameObjectCreates a Terrain including collider from TerrainData.

상속된 멤버

변수

enabledEnabled Behaviours are Updated, disabled Behaviours are not.
isActiveAndEnabledHas the Behaviour had enabled called.
gameObjectThe game object this component is attached to. A component is always attached to a game object.
tagThe tag of this game object.
transformThe Transform attached to this GameObject.
hideFlagsShould the object be hidden, saved with the scene or modifiable by the user?
nameThe name of the object.

Public 함수

BroadcastMessageCalls the method named methodName on every MonoBehaviour in this game object or any of its children.
CompareTagIs this game object tagged with tag ?
GetComponentReturns the component of Type type if the game object has one attached, null if it doesn't.
GetComponentInChildrenReturns the component of Type type in the GameObject or any of its children using depth first search.
GetComponentInParentReturns the component of Type type in the GameObject or any of its parents.
GetComponentsReturns all components of Type type in the GameObject.
GetComponentsInChildrenReturns all components of Type type in the GameObject or any of its children.
GetComponentsInParentReturns all components of Type type in the GameObject or any of its parents.
SendMessageCalls the method named methodName on every MonoBehaviour in this game object.
SendMessageUpwardsCalls the method named methodName on every MonoBehaviour in this game object and on every ancestor of the behaviour.
GetInstanceIDReturns the instance id of the object.
ToStringReturns the name of the game object.

정적 함수

DestroyRemoves a gameobject, component or asset.
DestroyImmediateDestroys the object obj immediately. You are strongly recommended to use Destroy instead.
DontDestroyOnLoadMakes the object target not be destroyed automatically when loading a new scene.
FindObjectOfTypeReturns the first active loaded object of Type type.
FindObjectsOfTypeReturns a list of all active loaded objects of Type type.
InstantiateClones the object original and returns the clone.

연산자

boolDoes the object exist?
operator !=Compares if two objects refer to a different object.
operator ==Compares two object references to see if they refer to the same object.