CustomInspector.cs 1.5 KB

12345678910111213141516171819202122232425262728293031323334353637
  1. //********************************** Banshee Engine (www.banshee3d.com) **************************************************//
  2. //**************** Copyright (c) 2016 Marko Pintera ([email protected]). All rights reserved. **********************//
  3. using System;
  4. using bs;
  5. namespace bs.Editor
  6. {
  7. /** @addtogroup Inspector
  8. * @{
  9. */
  10. /// <summary>
  11. /// Specifies that a class or a struct uses a custom inspector for GUI display. This attribute can be placed on an
  12. /// implementation of <see cref="Inspector"/> in which case the type must reference a <see cref="Component"/> or a
  13. /// <see cref="Resource"/>. Or it can be placed on an implementation of <see cref="InspectableField"/> in which
  14. /// case their type must reference any serializable class/struct, but may also reference an attribute in which case
  15. /// any serializable type with that attribute applied with have a custom inspector.
  16. /// </summary>
  17. [AttributeUsage(AttributeTargets.Class | AttributeTargets.Struct)]
  18. public sealed class CustomInspector : Attribute
  19. {
  20. #pragma warning disable 0414
  21. private Type type;
  22. #pragma warning restore 0414
  23. /// <summary>
  24. /// Creates a new custom inspector attribute.
  25. /// </summary>
  26. /// <param name="type">Type for which the custom inspector should be displayed.</param>
  27. public CustomInspector(Type type)
  28. {
  29. this.type = type;
  30. }
  31. }
  32. /** @} */
  33. }