using System;
using System.Collections.Generic;
namespace UnityEditor.Tilemaps
{
///
/// An attribute for GridBrushBase which specifies the TilemapEditorTool types which can work with the GridBrushBase.
///
[AttributeUsage(AttributeTargets.Class)]
public class BrushToolsAttribute : Attribute
{
private List m_ToolTypes;
internal List toolList
{
get { return m_ToolTypes; }
}
///
/// Constructor for BrushToolsAttribute. Specify the TilemapEditorTool types which can work with the GridBrushBase.
///
/// An array of TilemapEditorTool types which can work with the GridBrushBase.
public BrushToolsAttribute(params Type[] tools)
{
m_ToolTypes = new List();
foreach (var toolType in tools)
{
if (toolType.IsSubclassOf(typeof(TilemapEditorTool)) && !m_ToolTypes.Contains(toolType))
{
m_ToolTypes.Add(toolType);
}
}
}
}
}