Optimize automatic navmesh rebuild in editor for navmesh relevant actors only
This commit is contained in:
@@ -76,6 +76,29 @@ namespace FlaxEditor.SceneGraph
|
||||
_treeNode.LinkNode(this);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Gets a value indicating whether this actor affects navigation.
|
||||
/// </summary>
|
||||
public virtual bool AffectsNavigation => false;
|
||||
|
||||
/// <summary>
|
||||
/// Gets a value indicating whether this actor affects navigation or any of its children (recursive).
|
||||
/// </summary>
|
||||
public bool AffectsNavigationWithChildren
|
||||
{
|
||||
get
|
||||
{
|
||||
if (_actor.HasStaticFlag(StaticFlags.Navigation) && AffectsNavigation)
|
||||
return true;
|
||||
for (var i = 0; i < ChildNodes.Count; i++)
|
||||
{
|
||||
if (ChildNodes[i] is ActorNode actorChild && actorChild.AffectsNavigationWithChildren)
|
||||
return true;
|
||||
}
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Tries to find the tree node for the specified actor.
|
||||
/// </summary>
|
||||
|
||||
Reference in New Issue
Block a user