Version: 2023.2
言語: 日本語
public Type variantGroup ;

説明

Tool variants are used to group logically similar tools into a single button in the Tools Overlay.

The variantGroup type acts a key to specify groups of tools that should be considered a group in the UI.

using System;
using UnityEditor;
using UnityEditor.EditorTools;
using UnityEngine;

struct ShapeVariantGroup {}

// Define 3 tools that should be shown as a single button in the Tools Overlay.

[EditorTool("Line", variantGroup = typeof(ShapeVariantGroup), variantPriority = 2)] [Icon("Assets/Examples/Icons/Variant-Line.png")] class Line : EditorTool {}

[EditorTool("Circle", variantGroup = typeof(ShapeVariantGroup), variantPriority = 1)] [Icon("Assets/Examples/Icons/Variant-Circle.png")] class Circle : EditorTool {}

[EditorTool("Square", variantGroup = typeof(ShapeVariantGroup), variantPriority = 0)] [Icon("Assets/Examples/Icons/Variant-Square.png")] class Square : EditorTool {}
Copyright © 2023 Unity Technologies
优美缔软件(上海)有限公司 版权所有
"Unity"、Unity 徽标及其他 Unity 商标是 Unity Technologies 或其附属机构在美国及其他地区的商标或注册商标。其他名称或品牌是其各自所有者的商标。
公安部备案号:
31010902002961