Seven is the number.
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

35 lines
799 B

4 years ago
  1. using System;
  2. /// <summary>
  3. /// Sets the Unity script execution order
  4. /// </summary>
  5. /// <example>
  6. /// *Example:* Setting the execution order of a manager class using an attribute.
  7. ///
  8. /// ```csharp
  9. /// [BoltExecutionOrder(-5000)]
  10. /// public class SoundManager : MonoBehaviour
  11. /// {
  12. /// void Awake() {
  13. /// ConfigureSoundSettings();
  14. /// }
  15. /// }
  16. /// ```
  17. /// </example>
  18. [AttributeUsage(AttributeTargets.Class, Inherited = false, AllowMultiple = false)]
  19. public sealed class BoltExecutionOrderAttribute : Attribute
  20. {
  21. readonly int _executionOrder;
  22. public BoltExecutionOrderAttribute(int order)
  23. {
  24. _executionOrder = order;
  25. }
  26. /// <summary>
  27. /// The order of this script in execution (lower is earlier)
  28. /// </summary>
  29. public int executionOrder
  30. {
  31. get { return _executionOrder; }
  32. }
  33. }