public Vector3 center ;

描述

在对象的局部空间中测量的障碍物中心。

注意:创建 NavMeshObstacle 时,center 设为 0。

// Default center is (0, 0, 0)
using UnityEngine;
using UnityEngine.AI;

public class ExampleScript : MonoBehaviour { void Start() { NavMeshObstacle navMeshObstacle = gameObject.AddComponent<NavMeshObstacle>(); Debug.Log(navMeshObstacle.center); } }