variantGroup
Tool variants are used to group logically similar tools into a single button in the Tools Overlay.
Read time 1 minuteLast updated 5 days ago
Definition
- Type: Property
- Namespace: UnityEditor.EditorTools
- Assembly: UnityEditor.CoreModule
public Type variantGroup { get; set; }
Remarks
The ToolAttribute.variantGroup type acts a key to specify groups of tools that should be considered a group in the UI.
Examples
using System;using UnityEditor;using UnityEditor.EditorTools;using UnityEngine;namespace GlobalToolVariants{ // Define 3 tools that should be shown as a single button in the Tools Overlay. struct ShapeVariantGroup {} [EditorTool("Line (Custom Global)", variantGroup = typeof(ShapeVariantGroup), variantPriority = 2)] [Icon("Assets/Examples/Icons/Variant-Line.png")] class Line : EditorTool {} [EditorTool("Circle (Custom Global)", variantGroup = typeof(ShapeVariantGroup), variantPriority = 1)] [Icon("Assets/Examples/Icons/Variant-Circle.png")] class Circle : EditorTool {} [EditorTool("Square (Custom Global)", variantGroup = typeof(ShapeVariantGroup), variantPriority = 0)] [Icon("Assets/Examples/Icons/Variant-Square.png")] class Square : EditorTool {}}