CinemachinePropertyAttribute.cs 3.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687
  1. using UnityEngine;
  2. namespace Cinemachine
  3. {
  4. /// <summary>
  5. /// Property applied to AxisState. Used for custom drawing in the inspector.
  6. /// </summary>
  7. public sealed class AxisStatePropertyAttribute : PropertyAttribute {}
  8. /// <summary>
  9. /// Property applied to OrbitalTransposer.Heading. Used for custom drawing in the inspector.
  10. /// </summary>
  11. public sealed class OrbitalTransposerHeadingPropertyAttribute : PropertyAttribute {}
  12. /// <summary>
  13. /// Property applied to LensSettings. Used for custom drawing in the inspector.
  14. /// </summary>
  15. public sealed class LensSettingsPropertyAttribute : PropertyAttribute {}
  16. /// <summary>
  17. /// Property applied to Vcam Target fields. Used for custom drawing in the inspector.
  18. /// </summary>
  19. public sealed class VcamTargetPropertyAttribute : PropertyAttribute { }
  20. /// <summary>
  21. /// Property applied to CinemachineBlendDefinition. Used for custom drawing in the inspector.
  22. /// </summary>
  23. public sealed class CinemachineBlendDefinitionPropertyAttribute : PropertyAttribute {}
  24. /// <summary>
  25. /// Invoke play-mode-save for a class. This class's fields will be scanned
  26. /// upon exiting play mode, and its property values will be applied to the scene object.
  27. /// This is a stopgap measure that will become obsolete once Unity implements
  28. /// play-mode-save in a more general way.
  29. /// </summary>
  30. public sealed class SaveDuringPlayAttribute : System.Attribute {}
  31. /// <summary>
  32. /// Suppresses play-mode-save for a field. Use it if the calsee has [SaveDuringPlay]
  33. /// attribute but there are fields in the class that shouldn't be saved.
  34. /// </summary>
  35. public sealed class NoSaveDuringPlayAttribute : PropertyAttribute {}
  36. /// <summary>Property field is a Tag.</summary>
  37. public sealed class TagFieldAttribute : PropertyAttribute {}
  38. /// <summary>Property field is a NoiseSettings asset.</summary>
  39. public sealed class NoiseSettingsPropertyAttribute : PropertyAttribute {}
  40. /// <summary>
  41. /// Used for custom drawing in the inspector.
  42. /// </summary>
  43. public sealed class CinemachineEmbeddedAssetPropertyAttribute : PropertyAttribute
  44. {
  45. public bool WarnIfNull;
  46. public CinemachineEmbeddedAssetPropertyAttribute(bool warnIfNull = false)
  47. {
  48. WarnIfNull = warnIfNull;
  49. }
  50. }
  51. /// <summary>
  52. /// Atrtribute to control the automatic generation of documentation.
  53. /// </summary>
  54. [DocumentationSorting(DocumentationSortingAttribute.Level.Undoc)]
  55. public sealed class DocumentationSortingAttribute : System.Attribute
  56. {
  57. /// <summary>Refinement level of the documentation</summary>
  58. public enum Level
  59. {
  60. /// <summary>Type is excluded from documentation</summary>
  61. Undoc,
  62. /// <summary>Type is documented in the API reference</summary>
  63. API,
  64. /// <summary>Type is documented in the highly-refined User Manual</summary>
  65. UserRef
  66. };
  67. /// <summary>Refinement level of the documentation. The more refined, the more is excluded.</summary>
  68. public Level Category { get; private set; }
  69. /// <summary>Contructor with specific values</summary>
  70. public DocumentationSortingAttribute(Level category)
  71. {
  72. Category = category;
  73. }
  74. }
  75. }