CinemachinePropertyAttribute.cs 3.7 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192
  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. /// This attributs is obsolete and unused.
  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. Inspector will show a foldout with the asset contents
  42. /// </summary>
  43. public sealed class CinemachineEmbeddedAssetPropertyAttribute : PropertyAttribute
  44. {
  45. /// <summary>If true, inspector will display a warning if the embedded asset is null</summary>
  46. public bool WarnIfNull;
  47. /// <summary>Standard constructor</summary>
  48. /// <param name="warnIfNull">If true, inspector will display a warning if the embedded asset is null</param>
  49. public CinemachineEmbeddedAssetPropertyAttribute(bool warnIfNull = false)
  50. {
  51. WarnIfNull = warnIfNull;
  52. }
  53. }
  54. /// <summary>
  55. /// Atrtribute to control the automatic generation of documentation. This attribute is obsolete and not used.
  56. /// </summary>
  57. [DocumentationSorting(DocumentationSortingAttribute.Level.Undoc)]
  58. public sealed class DocumentationSortingAttribute : System.Attribute
  59. {
  60. /// <summary>Refinement level of the documentation</summary>
  61. public enum Level
  62. {
  63. /// <summary>Type is excluded from documentation</summary>
  64. Undoc,
  65. /// <summary>Type is documented in the API reference</summary>
  66. API,
  67. /// <summary>Type is documented in the highly-refined User Manual</summary>
  68. UserRef
  69. };
  70. /// <summary>Refinement level of the documentation. The more refined, the more is excluded.</summary>
  71. public Level Category { get; private set; }
  72. /// <summary>Contructor with specific values</summary>
  73. /// <param name="category">Documentation level</param>
  74. public DocumentationSortingAttribute(Level category)
  75. {
  76. Category = category;
  77. }
  78. }
  79. }