Merge branch 'load-source-log' of https://github.com/Menotdan/FlaxEngine into Menotdan-load-source-log

This commit is contained in:
Wojtek Figat
2024-06-11 11:54:45 +02:00
7 changed files with 180 additions and 14 deletions

View File

@@ -228,7 +228,7 @@ namespace FlaxEditor.Modules
new SearchResult { Name = item.ShortName, Type = assetItem.TypeName, Item = item }
};
}
var actor = FlaxEngine.Object.Find<Actor>(ref id);
var actor = FlaxEngine.Object.Find<Actor>(ref id, true);
if (actor != null)
{
return new List<SearchResult>
@@ -236,6 +236,16 @@ namespace FlaxEditor.Modules
new SearchResult { Name = actor.Name, Type = actor.TypeName, Item = actor }
};
}
var script = FlaxEngine.Object.Find<Script>(ref id, true);
if (script != null && script.Actor != null)
{
string actorPathStart = $"{script.Actor.Name}/";
return new List<SearchResult>
{
new SearchResult { Name = $"{actorPathStart}{script.TypeName}", Type = script.TypeName, Item = script }
};
}
}
Profiler.BeginEvent("ContentFinding.Search");
@@ -388,6 +398,13 @@ namespace FlaxEditor.Modules
Editor.Instance.SceneEditing.Select(actor);
Editor.Instance.Windows.EditWin.Viewport.FocusSelection();
break;
case Script script:
if (script.Actor != null)
{
Editor.Instance.SceneEditing.Select(script.Actor);
Editor.Instance.Windows.EditWin.Viewport.FocusSelection();
}
break;
}
}