Ei kuvausta
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

BrushToolsAttribute.cs 731B

123456789101112131415161718192021222324252627
  1. using System;
  2. using System.Collections.Generic;
  3. namespace UnityEditor.Tilemaps
  4. {
  5. [AttributeUsage(AttributeTargets.Class, AllowMultiple = false)]
  6. public class BrushToolsAttribute : Attribute
  7. {
  8. private List<Type> m_ToolTypes;
  9. internal List<Type> toolList
  10. {
  11. get { return m_ToolTypes; }
  12. }
  13. public BrushToolsAttribute(params Type[] tools)
  14. {
  15. m_ToolTypes = new List<Type>();
  16. foreach (var toolType in tools)
  17. {
  18. if (toolType.IsSubclassOf(typeof(TilemapEditorTool)) && !m_ToolTypes.Contains(toolType))
  19. {
  20. m_ToolTypes.Add(toolType);
  21. }
  22. }
  23. }
  24. }
  25. }