Skip to content

Added [DefaultExecutionOrder(-50)] to MonoSingleton#23

Merged
hasanbayatme merged 1 commit intoUnityCommunity:mainfrom
nnra6864:DefaultExecutionOrder
Sep 15, 2025
Merged

Added [DefaultExecutionOrder(-50)] to MonoSingleton#23
hasanbayatme merged 1 commit intoUnityCommunity:mainfrom
nnra6864:DefaultExecutionOrder

Conversation

@nnra6864
Copy link
Contributor

Afaik, this causes no harm and ensures the singleton functions(such as Awake, Update etc.) are executed before other classes. This can be changed in inherited classes if needed, but in 99% of the cases, I would say that you'd want the singleton to execute first. -50 seemed like a reasonable choice due to certain built in classes utilizing up to -100(e.g. UnityEngine.InputSystem.PlayerInput) and this way we still get plenty of free room around the singleton.

Afaik, this causes no harm and ensures the singleton functions(such as
Awake, Update etc.) are executed before other classes.
This can be changed in inherited classes if needed, but in 99% of the
cases, I would say that you'd want the singleton to execute first.
-50 seemed like a reasonable choice due to certain built in classes
utilizing up to -100(e.g. UnityEngine.InputSystem.PlayerInput) and this
way we still get plenty of free room around the singleton.
@hasanbayatme
Copy link
Member

Sounds great, thanks for the PR!

@hasanbayatme hasanbayatme merged commit b70b666 into UnityCommunity:main Sep 15, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants