CustomInspector.cs 1.3 KB

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