A game about forced loneliness, made by TACStudios
1using System;
2using System.Collections.Generic;
3
4namespace UnityEditor.Tilemaps
5{
6 /// <summary>
7 /// An attribute for GridBrushBase which specifies the TilemapEditorTool types which can work with the GridBrushBase.
8 /// </summary>
9 [AttributeUsage(AttributeTargets.Class)]
10 public class BrushToolsAttribute : Attribute
11 {
12 private List<Type> m_ToolTypes;
13 internal List<Type> toolList
14 {
15 get { return m_ToolTypes; }
16 }
17
18 /// <summary>
19 /// Constructor for BrushToolsAttribute. Specify the TilemapEditorTool types which can work with the GridBrushBase.
20 /// </summary>
21 /// <param name="tools">An array of TilemapEditorTool types which can work with the GridBrushBase.</param>
22 public BrushToolsAttribute(params Type[] tools)
23 {
24 m_ToolTypes = new List<Type>();
25 foreach (var toolType in tools)
26 {
27 if (toolType.IsSubclassOf(typeof(TilemapEditorTool)) && !m_ToolTypes.Contains(toolType))
28 {
29 m_ToolTypes.Add(toolType);
30 }
31 }
32 }
33 }
34}