Created
November 10, 2016 19:48
-
-
Save noisecrime/eeb9093294f1478c6a6c4a819c7b4b9a to your computer and use it in GitHub Desktop.
Support Attribute class that works with the editor script 'ScriptExecutionAssignment' to automatically populate the ScriptExecutionOrder.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// ScriptExecutionAttribute | |
// NoiseCrime | |
// 10.11.2016 | |
// 05.06.2016 | |
// | |
// Support Attribute class that works with the editor script 'ScriptExecutionAssignment' to automatically populate the ScriptExecutionOrder. | |
// Simply add [ScriptExecutionAttribute( value )] prior to your class declaration, where value indicates the script order you want ( -9999 to +9999 ) | |
// This script must NOT be placed in an Editor Folder. | |
// Example | |
// using UnityEngine; | |
// | |
// [ScriptExecutionAttribute( -9802 )] | |
// public class ApplicationStartUp : MonoBehaviour | |
// { | |
// void Awake() | |
// { | |
// ... | |
// } | |
// } | |
using System; | |
[AttributeUsage( AttributeTargets.Class, Inherited = false, AllowMultiple = false)] | |
public class ScriptExecutionAttribute : Attribute | |
{ | |
public readonly int executionIndex; | |
public ScriptExecutionAttribute( int index ) | |
{ | |
this.executionIndex = index; | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment