- Added profiling

This commit is contained in:
Nils Hausfeld
2023-09-24 20:22:44 +02:00
parent 038a3603e4
commit 8d39d51f90
2 changed files with 11 additions and 3 deletions

View File

@@ -136,6 +136,8 @@ namespace FlaxEditor.Surface.ContextMenu
return;
}
Profiler.BeginEvent("VisjectCMGroup.EvaluateVisibilityWithBox");
bool isAnyVisible = false;
for (int i = 0; i < _children.Count; i++)
{
@@ -155,6 +157,8 @@ namespace FlaxEditor.Surface.ContextMenu
// Hide group if none of the items matched the filter
Visible = false;
}
Profiler.EndEvent();
}
/// <summary>

View File

@@ -121,6 +121,8 @@ namespace FlaxEditor.Surface.ContextMenu
if(_archetype?.Elements == null)
return false;
Profiler.BeginEvent("VisjectCMItem.IsCompatibleWithBox");
bool isCompatible = false;
foreach (NodeElementArchetype element in _archetype.Elements)
{
@@ -129,11 +131,11 @@ namespace FlaxEditor.Surface.ContextMenu
if ((box.IsOutput && element.Type == NodeElementType.Output) || (!box.IsOutput && element.Type == NodeElementType.Input))
continue;
bool checkCompatibility = box.CanUseType(element.ConnectionsType);;
bool checkCompatibility = ((element.ConnectionsType == null || element.ConnectionsType == typeof(void)) && box.CurrentType != typeof(FlaxEngine.Object));
if (!checkCompatibility)
{
if ((element.ConnectionsType == null || element.ConnectionsType == typeof(void)) && box.CurrentType != typeof(FlaxEngine.Object))
if (box.CanUseType(element.ConnectionsType))
checkCompatibility = true;
}
isCompatible |= checkCompatibility;
@@ -143,6 +145,8 @@ namespace FlaxEditor.Surface.ContextMenu
}
Visible = isCompatible;
Profiler.EndEvent();
return isCompatible;
}