格式
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);