Unity_彩色增强层级插件

主要是Enhanced Hierarchy和Rainbow Hierarchy插件

能不能真的提高效率且不谈, 这种花里胡哨的风格我就很喜欢


Enhanced Hierarchy插件

配置页面机翻汉化:

位于插件目录下Preferences.cs第99行, 插件版本2.4.5

#region PrefItems
[AutoPrefItem]
[AutoPrefItemDefaultValue(true)]
[AutoPrefItemLabel("启用", "启用或禁用整个插件, 如果出现错误将自动禁用")]
public static PrefItem<bool> Enabled;

[AutoPrefItem]
[AutoPrefItemDefaultValue(0)]
[AutoPrefItemLabel("右边距", "图标的边距,如果您有更多也使用层次结构的扩展,则很有用")]
public static PrefItem<int> RightMargin;

[AutoPrefItem]
[AutoPrefItemDefaultValue(0)]
[AutoPrefItemLabel("左边距", "图标的边距,如果您有更多也使用层次结构的扩展,则很有用")]
public static PrefItem<int> LeftMargin;

[AutoPrefItem]
[AutoPrefItemDefaultValue(14)]
[AutoPrefItemLabel("缩进", "缩进标签,对薄层级很有用")]
public static PrefItem<int> Indent;

[AutoPrefItem]
[AutoPrefItemDefaultValue(0.8f)]
[AutoPrefItemLabel("层级树不透明度", "树视图线的不透明度将子变换连接到它们的父级,如果您在子级中有多个子级,则很有用")]
public static PrefItem<float> TreeOpacity;

[AutoPrefItem]
[AutoPrefItemDefaultValue(0.5f)]
[AutoPrefItemLabel("枝干比例", "没有子项的层次结构项的枝干长度")]
public static PrefItem<float> TreeStemProportion;

[AutoPrefItem]
[AutoPrefItemDefaultValue(true)]
[AutoPrefItemLabel("单击树线选择父对象", "可能会影响性能")]
public static PrefItem<bool> SelectOnTree;

[AutoPrefItem]
[AutoPrefItemDefaultValue(true)]
[AutoPrefItemLabel("工具提示", "显示工具提示,比如这个")]
public static PrefItem<bool> Tooltips;

[AutoPrefItem]
[AutoPrefItemDefaultValue(true)]
[AutoPrefItemLabel("仅相关工具提示", "隐藏具有静态文本的工具提示")]
public static PrefItem<bool> RelevantTooltipsOnly;

[AutoPrefItem]
[AutoPrefItemDefaultValue(true)]
[AutoPrefItemLabel("增强选择", "允许通过用鼠标右键拖动来批量选择游戏对象")]
public static PrefItem<bool> EnhancedSelection;

[AutoPrefItem]
[AutoPrefItemLabel("突出颜色", "为鼠标光标悬停的对象设置高亮颜色")]
public static PrefItem<Color> HoverTintColor;

[AutoPrefItem]
[AutoPrefItemDefaultValue(false)]
[AutoPrefItemLabel("隐藏原生图标", "隐藏名称左侧的原生图标")]
public static PrefItem<bool> DisableNativeIcon;

[AutoPrefItem]
[AutoPrefItemDefaultValue(true)]
[AutoPrefItemLabel("名称拖尾", "当对象名称大于视图区域时在最后附加...省略号")]
public static PrefItem<bool> Trailing;

[AutoPrefItem]
[AutoPrefItemDefaultValue(true)]
[AutoPrefItemLabel("选择锁定的对象", "允许选择锁定的对象")]
public static PrefItem<bool> AllowSelectingLockedObjects;

[AutoPrefItem]
[AutoPrefItemDefaultValue(false)]
[AutoPrefItemLabel("拾取锁定的对象", "允许拾取锁定在场景视图中的对象\n更改此选项之前锁定的对象不会受到影响")]
public static PrefItem<bool> AllowPickingLockedObjects;

[AutoPrefItem]
[AutoPrefItemDefaultValue(true)]
[AutoPrefItemLabel("更改所有选定对象", "这将使启用、锁定、图层、标签和静态按钮影响层次结构中的所有选定对象")]
public static PrefItem<bool> ChangeAllSelected;

[AutoPrefItem]
[AutoPrefItemDefaultValue(true)]
[AutoPrefItemLabel("最左边的左侧按钮", "将左按钮放在层次结构的最左侧,如果禁用它将在游戏对象名称旁边")]
public static PrefItem<bool> LeftmostButton;

[AutoPrefItem]
[AutoPrefItemDefaultValue(true)]
[AutoPrefItemLabel("打开日志脚本", "单击警告、日志或错误将打开脚本以在您的 IDE 或文本编辑器中进行编辑\n可能会影响性能")]
public static PrefItem<bool> OpenScriptsOfLogs;

[AutoPrefItem]
[AutoPrefItemDefaultValue(false)]
[AutoPrefItemLabel("替换默认子切换", "将用于扩展子项的默认切换替换为显示子项计数的新切换项")]
public static PrefItem<bool> NumericChildExpand;

[AutoPrefItem]
[AutoPrefItemDefaultValue(true)]
[AutoPrefItemLabel("较小的字体", "在小标签上使用较小的字体来缩小层次结构")]
public static PrefItem<bool> SmallerMiniLabel;

[AutoPrefItem]
[AutoPrefItemDefaultValue(15)]
[AutoPrefItemLabel("图标大小", "图标的大小 (以像素为单位)")]
public static PrefItem<int> IconsSize;

[AutoPrefItem]
[AutoPrefItemDefaultValue(true)]
[AutoPrefItemLabel("尽可能集中", "当只有标签或只有层时集中迷你标签")]
public static PrefItem<bool> CentralizeMiniLabelWhenPossible;

[AutoPrefItem]
[AutoPrefItemDefaultValue(true)]
[AutoPrefItemLabel("隐藏“未标记”标签", "隐藏迷你标签上的默认标签")]
public static PrefItem<bool> HideDefaultTag;

[AutoPrefItem]
[AutoPrefItemDefaultValue(true)]
[AutoPrefItemLabel("隐藏“默认”图层", "隐藏迷你标签上的默认图层")]
public static PrefItem<bool> HideDefaultLayer;

[AutoPrefItem]
[AutoPrefItemDefaultValue(false)]
[AutoPrefItemLabel("隐藏默认图标", "隐藏默认游戏对象图标")]
public static PrefItem<bool> HideDefaultIcon;

[AutoPrefItem]
[AutoPrefItemDefaultValue(1)]
[AutoPrefItemLabel("分隔线粗细", "分隔线粗细")]
public static PrefItem<int> LineSize;

[AutoPrefItem]
[AutoPrefItemLabel("奇数行背景颜色", "奇数行的色调")]
public static PrefItem<Color> OddRowColor;

[AutoPrefItem]
[AutoPrefItemLabel("偶数行背景颜色", "偶数行的色调")]
public static PrefItem<Color> EvenRowColor;

[AutoPrefItem]
[AutoPrefItemLabel("线条颜色", "分隔线的色调")]
public static PrefItem<Color> LineColor;

[AutoPrefItem]
[AutoPrefItemLabel("左侧按钮", "将出现在层次结构左侧的按钮\n禁用“层次结构树”后看起来会更好")]
public static PrefItem<IconData> LeftSideButtonPref;

[AutoPrefItem]
[AutoPrefItemLabel("迷你标签", "游戏对象名称旁边的小标签")]
public static PrefItem<int[]> MiniLabels;

[AutoPrefItem]
[AutoPrefItemDefaultValue(ChildrenChangeMode.ObjectAndChildren)]
[AutoPrefItemLabel("锁定", "单击锁定开关时将锁定哪些对象")]
public static PrefItem<ChildrenChangeMode> LockAskMode;

[AutoPrefItem]
[AutoPrefItemDefaultValue(ChildrenChangeMode.Ask)]
[AutoPrefItemLabel("图层", "当您单击图层按钮或迷你标签时,哪些对象的图层将发生变化")]
public static PrefItem<ChildrenChangeMode> LayerAskMode;

[AutoPrefItem]
[AutoPrefItemDefaultValue(ChildrenChangeMode.ObjectOnly)]
[AutoPrefItemLabel("标签", "当您单击标签按钮或迷你标签时,哪些对象的标签会更改")]
public static PrefItem<ChildrenChangeMode> TagAskMode;

[AutoPrefItem]
[AutoPrefItemDefaultValue(ChildrenChangeMode.Ask)]
[AutoPrefItemLabel("静态", "单击静态切换时将更改哪些对象的静态标志")]
public static PrefItem<ChildrenChangeMode> StaticAskMode;

[AutoPrefItem]
[AutoPrefItemDefaultValue(ChildrenChangeMode.ObjectOnly)]
[AutoPrefItemLabel("图标", "单击图标按钮时,哪些对象的图标将发生变化")]
public static PrefItem<ChildrenChangeMode> IconAskMode;

[AutoPrefItem]
[AutoPrefItemLabel("对象名称旁边的图标", "出现在游戏对象名称旁边的图标")]
public static PrefItem<IconList> LeftIcons;

[AutoPrefItem]
[AutoPrefItemLabel("最右边的图标", "显示在层次结构最右侧的图标")]
public static PrefItem<IconList> RightIcons;

[AutoPrefItem]
[AutoPrefItemLabel("按图层分配颜色", "为每个不同的图层设置行颜色")]
public static PrefItem<List<LayerColor>> PerLayerRowColors;
#endregion

一些提示机翻

  • Alt+点击子对象的折叠展开切换也会同时展开所有的孙对象的折叠
  • “使用的内存”可能会创建垃圾,从而导致卡顿,如果项目有较大的性能要求,则将其禁用
  • 请记住,在删除或禁用此扩展时,始终要先解锁您的游戏对象,因为删除或禁用插件后您将无法解锁对象,并且可能丢失场景数据

附带的说明文档的机翻:

如何打开配置界面

配置界面位于Unity首选项中,通过菜单栏的"编辑">"首选项"进入(macOS是Unity/Preferences), 您将看到“层次结构”或“增强层次结构”选项卡

插件自己禁用了,该怎么办

您可能按下了 Ctrl + H,这是启用和禁用的快捷方式, 只需再次按下快捷键, 它应该可以工作

Debug.Log、Debug.LogWarning和Debug.LogError不显示

插件扩展带有一些脚本, 调用调试打印信息需要将对象作为方法的参数传递,如下所示:

Debug.Log("Something", this);

或者干脆使用 print 方法

使用扩展后游戏无法编译

扩展必须放在 Editor 文件夹中, 因为它使用编辑器

如何使用增强选择

只需使用鼠标右键拖动层次结构项目 (仅限 Windows)


Rainbow Hierarchy插件

配置面板

  • 对象-规则将仅应用于指定的游戏对象
  •     (或名称-该规则将应用于所有具有该名称的游戏对象)
  • 优先级-如果有多个规则应用于同一层级项目, 则将应用优先级最高的规则
  • 图标-应用于相应对象的图标, 可以从预设中选择或导入自定义图标
  • 背景-应用于对应对象的背景, 可以从预设中选择或导入自定义纹理
  • 递归复选框-相同的图标或背景将自动应用于所有子对象

其他一些插件设置在项目设置里, 感觉没啥用懒得去找翻译了

猜你喜欢

转载自blog.csdn.net/qq_36917144/article/details/127850099