Improve editor tooltips for actors and scripts
This commit is contained in:
@@ -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 />
|
||||
|
||||
@@ -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;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user