CustomInspector.cs 1.1 KB

123456789101112131415161718192021222324252627
  1. using System;
  2. using BansheeEngine;
  3. namespace BansheeEditor
  4. {
  5. /// <summary>
  6. /// Specifies that a class or a struct uses a custom inspector for GUI display. This attribute can be placed on an
  7. /// implementation of <see cref="Inspector"/> in which case the type must reference a <see cref="Component"/> or a
  8. /// <see cref="Resource"/>. Or it can be placed on an implementation of <see cref="InspectableField"/> in which
  9. /// case they type must reference any serializable class/struct, but may also reference an attribute in which case
  10. /// any serializable type with that attribute applied with have a custom inspector.
  11. /// </summary>
  12. [AttributeUsage(AttributeTargets.Class | AttributeTargets.Struct)]
  13. public sealed class CustomInspector : Attribute
  14. {
  15. private Type type;
  16. /// <summary>
  17. /// Creates a new custom inspector attribute.
  18. /// </summary>
  19. /// <param name="type">Type for which the custom inspector should be displayed.</param>
  20. public CustomInspector(Type type)
  21. {
  22. this.type = type;
  23. }
  24. }
  25. }