format
typescript
ComponentSettings.ExecuteOrder(order)class: ComponentSettings
description
Controls the execution order of the script. The default value is 2000, where smaller values are executed first and larger values are executed later.
parameter
| param_name | type | description |
|---|---|---|
| order | number | The value that controls the execution order. The default value is 2000. |
return
| type | description |
|---|---|
void |
code example
javascript
@ComponentSettings.ExecuteOrder(2001)
class Test
extends Component
implements IOnUpdate, IOnCollisionEnter {
OnCollisionEnter(collision: Collision): void {
}
OnUpdate(): void {
Debug.Log("on updating!");
}
}
function main() {
var go = new GameObject("abc");
go.AddComponent(Test);
}