Improve editor tooltips for actors and scripts

This commit is contained in:
Wojtek Figat
2021-09-21 17:22:22 +02:00
parent 0ec16de569
commit 9f18a27b0b
2 changed files with 5 additions and 3 deletions

View File

@@ -32,9 +32,8 @@ namespace FlaxEditor.GUI
public ActorItemView(Actor actor)
{
_actor = actor;
Name = actor.Name;
TooltipText = actor.TypeName;
TooltipText = Utilities.Utils.GetTooltip(actor);
}
/// <inheritdoc />

View File

@@ -78,13 +78,16 @@ namespace FlaxEditor.Utilities
internal static string GetTooltip(SceneObject obj)
{
var str = obj is Actor actor ? actor.Name : TypeUtils.GetObjectType(obj).Name;
var actor = obj as Actor;
var str = actor != null ? actor.Name : TypeUtils.GetObjectType(obj).Name;
var o = obj.Parent;
while (o)
{
str = o.Name + " -> " + str;
o = o.Parent;
}
if (actor != null)
str += string.Format(" ({0})", TypeUtils.GetObjectType(obj).Name);
return str;
}