using System;
///
/// Sets the Unity script execution order
///
///
/// *Example:* Setting the execution order of a manager class using an attribute.
///
/// ```csharp
/// [BoltExecutionOrder(-5000)]
/// public class SoundManager : MonoBehaviour
/// {
/// void Awake() {
/// ConfigureSoundSettings();
/// }
/// }
/// ```
///
[AttributeUsage(AttributeTargets.Class, Inherited = false, AllowMultiple = false)]
public sealed class BoltExecutionOrderAttribute : Attribute
{
readonly int _executionOrder;
public BoltExecutionOrderAttribute(int order)
{
_executionOrder = order;
}
///
/// The order of this script in execution (lower is earlier)
///
public int executionOrder
{
get { return _executionOrder; }
}
}