浏览代码

Updated NavMesh

/main
Andre McGrail 6 年前
当前提交
92226c93
共有 1 个文件被更改,包括 37 次插入12 次删除
  1. 49
      Assets/NavMeshComponents/Scripts/NavMeshSurface.cs

49
Assets/NavMeshComponents/Scripts/NavMeshSurface.cs


void AppendModifierVolumes(ref List<NavMeshBuildSource> sources)
{
#if UNITY_EDITOR
var myStage = StageUtility.GetStage(gameObject);
var myStage = StageUtility.GetStageHandle(gameObject);
if (!myStage.IsValid())
return;
#endif

markups.Add(markup);
}
var scene = gameObject.scene;
if (m_CollectObjects == CollectObjects.All)
#if UNITY_EDITOR
if (!EditorApplication.isPlaying)
NavMeshBuilder.CollectSources(null, m_LayerMask, m_UseGeometry, m_DefaultArea, markups, scene, sources);
if (m_CollectObjects == CollectObjects.All)
{
UnityEditor.AI.NavMeshBuilder.CollectSourcesInStage(
null, m_LayerMask, m_UseGeometry, m_DefaultArea, markups, gameObject.scene, sources);
}
else if (m_CollectObjects == CollectObjects.Children)
{
UnityEditor.AI.NavMeshBuilder.CollectSourcesInStage(
transform, m_LayerMask, m_UseGeometry, m_DefaultArea, markups, gameObject.scene, sources);
}
else if (m_CollectObjects == CollectObjects.Volume)
{
Matrix4x4 localToWorld = Matrix4x4.TRS(transform.position, transform.rotation, Vector3.one);
var worldBounds = GetWorldBounds(localToWorld, new Bounds(m_Center, m_Size));
UnityEditor.AI.NavMeshBuilder.CollectSourcesInStage(
worldBounds, m_LayerMask, m_UseGeometry, m_DefaultArea, markups, gameObject.scene, sources);
}
else if (m_CollectObjects == CollectObjects.Children)
else
#endif
NavMeshBuilder.CollectSources(transform, m_LayerMask, m_UseGeometry, m_DefaultArea, markups, scene, sources);
}
else if (m_CollectObjects == CollectObjects.Volume)
{
Matrix4x4 localToWorld = Matrix4x4.TRS(transform.position, transform.rotation, Vector3.one);
var worldBounds = GetWorldBounds(localToWorld, new Bounds(m_Center, m_Size));
NavMeshBuilder.CollectSources(worldBounds, m_LayerMask, m_UseGeometry, m_DefaultArea, markups, scene, sources);
if (m_CollectObjects == CollectObjects.All)
{
NavMeshBuilder.CollectSources(null, m_LayerMask, m_UseGeometry, m_DefaultArea, markups, sources);
}
else if (m_CollectObjects == CollectObjects.Children)
{
NavMeshBuilder.CollectSources(transform, m_LayerMask, m_UseGeometry, m_DefaultArea, markups, sources);
}
else if (m_CollectObjects == CollectObjects.Volume)
{
Matrix4x4 localToWorld = Matrix4x4.TRS(transform.position, transform.rotation, Vector3.one);
var worldBounds = GetWorldBounds(localToWorld, new Bounds(m_Center, m_Size));
NavMeshBuilder.CollectSources(worldBounds, m_LayerMask, m_UseGeometry, m_DefaultArea, markups, sources);
}
}
if (m_IgnoreNavMeshAgent)

正在加载...
取消
保存