Skip to content

格式

typescript
NavMeshObstacle.height

所属类: NavMeshObstacle

描述

圆柱体高度。

当shape为Cylinder时,height为圆柱体的高度。当shape为Box时,读写height为非法操作。

参数

参数名类型描述

返回值

类型描述
number圆柱体高度

代码示例

typescript
let obj = new GameObject();
let com = obj.AddComponent<NavMeshObstacle>(NavMeshObstacle);
com.shape = NavMeshObstacleShape.Cylinder;
com.height = 1;
Debug.Log("NavMeshObstacle: height = ", com.height);