You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: README.md
+6-1Lines changed: 6 additions & 1 deletion
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -5,11 +5,14 @@ A collection of attributes to control the execution order of your scripts in Uni
5
5
## Use
6
6
Add one of these attribute to your script's class definition to change its script execution order :
7
7
-`[ExecutionOrder(int order)]` : The script execution order is set to `order`
8
-
-`[ExecuteAfter(Type type)]` : The script execution order is set to a value superior to the one of the script `type`. This will ensure that your script will be executed after the script `type`. By default, the script execution order is increased by 10.
8
+
-`[ExecuteAfter(Type type)]` : The script execution order is set to a value greater than the one of the script `type`. This will ensure that your script will be executed after the script `type`. By default, the script execution order is increased by 10.
9
9
10
10
A script can have multiple `ExecuteAfter` attributes and will be executed after all the scripts given in parameters.
11
11
A script cannot have both an `ExecutionOrder` and an `ExecuteAfter` attribute.
12
12
13
+
Changing the execution order of a script with either an `ExecutionOrder` or an `ExecuteAfter` attribute from the *Script Execution Order* inspector in Unity will have no effect. The order will be reset to the one defined by the attributes.
14
+
15
+
Changing a script execution order, either from the inspector or with an attribute, will cause a recompilation of the scripts.
13
16
14
17
## Example
15
18
```csharp
@@ -48,4 +51,6 @@ public class Script4 : MonoBehaviour {
48
51
}
49
52
}
50
53
```
54
+
The resulting script execution orders in the inspector:
51
55
56
+

0 commit comments