Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 8 additions & 0 deletions Assets/NavMeshComponents/Editor/NavMeshSurfaceEditor.cs
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@ class NavMeshSurfaceEditor : Editor
SerializedProperty m_Size;
SerializedProperty m_TileSize;
SerializedProperty m_UseGeometry;
SerializedProperty m_IgnoreTriggerColliders;
SerializedProperty m_VoxelSize;

#if NAVMESHCOMPONENTS_SHOW_NAVMESHDATA_REF
Expand Down Expand Up @@ -73,6 +74,7 @@ void OnEnable()
m_Size = serializedObject.FindProperty("m_Size");
m_TileSize = serializedObject.FindProperty("m_TileSize");
m_UseGeometry = serializedObject.FindProperty("m_UseGeometry");
m_IgnoreTriggerColliders = serializedObject.FindProperty("m_IgnoreTriggerColliders");
m_VoxelSize = serializedObject.FindProperty("m_VoxelSize");

#if NAVMESHCOMPONENTS_SHOW_NAVMESHDATA_REF
Expand Down Expand Up @@ -132,6 +134,12 @@ public override void OnInspectorGUI()

EditorGUILayout.PropertyField(m_LayerMask, s_Styles.m_LayerMask);
EditorGUILayout.PropertyField(m_UseGeometry);
if ((NavMeshCollectGeometry)m_UseGeometry.enumValueIndex == NavMeshCollectGeometry.PhysicsColliders)
{
EditorGUI.indentLevel++;
EditorGUILayout.PropertyField(m_IgnoreTriggerColliders);
EditorGUI.indentLevel--;
}

EditorGUILayout.Space();

Expand Down
7 changes: 7 additions & 0 deletions Assets/NavMeshComponents/Scripts/NavMeshSurface.cs
Original file line number Diff line number Diff line change
Expand Up @@ -55,6 +55,10 @@ public class NavMeshSurface : MonoBehaviour
bool m_IgnoreNavMeshObstacle = true;
public bool ignoreNavMeshObstacle { get { return m_IgnoreNavMeshObstacle; } set { m_IgnoreNavMeshObstacle = value; } }

[SerializeField]
bool m_IgnoreTriggerColliders = false;
public bool ignoreTriggerColliders { get { return m_IgnoreTriggerColliders; } set { m_IgnoreTriggerColliders = value; } }

[SerializeField]
bool m_OverrideTileSize;
public bool overrideTileSize { get { return m_OverrideTileSize; } set { m_OverrideTileSize = value; } }
Expand Down Expand Up @@ -346,6 +350,9 @@ List<NavMeshBuildSource> CollectSources()
if (m_IgnoreNavMeshObstacle)
sources.RemoveAll((x) => (x.component != null && x.component.gameObject.GetComponent<NavMeshObstacle>() != null));

if (m_UseGeometry == NavMeshCollectGeometry.PhysicsColliders && m_IgnoreTriggerColliders)
sources.RemoveAll((x) => (x.component != null && x.component.gameObject.TryGetComponent(out Collider col) && col.isTrigger));

AppendModifierVolumes(ref sources);

return sources;
Expand Down