Terrain
- activeTerrain
- AddTreeInstance
- basemapDistance
- castShadows
- CreateTerrainGameObject
- detailObjectDensity
- detailObjectDistance
- editorRenderFlags
- Flush
- GetPosition
- heightmapMaximumLOD
- heightmapPixelError
- lightmapIndex
- SampleHeight
- SetNeighbors
- terrainData
- treeBillboardDistance
- treeCrossFadeLength
- treeDistance
- treeMaximumFullLODCount
Terrain.SampleHeight 取样高度
function SampleHeight (worldPosition : Vector3) : float
Description描述
Samples the height at the given position defined in world space, relative to the terrain space.
在给定位置定义的取样高度,相对于地形坐标空间。
using UnityEngine;
using System.Collections;
public class example : MonoBehaviour {
void LateUpdate() {
transform.position.y = Terrain.activeTerrain.SampleHeight(transform.position);
}
}
function LateUpdate () {
transform.position.y = Terrain.activeTerrain.SampleHeight(transform.position);
}
最后修改:2011年4月1日 Friday 18:43