Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

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

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
hasanbayatme merged 1 commit into UnityCommunity:main from nnra6864:DefaultExecutionOrder
Sep 15, 2025

Conversation

@nnra6864
Copy link
Contributor

@nnra6864 nnra6864 commented Sep 15, 2025

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.
Copy link
Member

Sounds great, thanks for the PR!

nnra6864 reacted with thumbs up emoji

@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

Reviewers

No reviews

Assignees

No one assigned

Labels

None yet

Projects

None yet

Milestone

No milestone

Development

Successfully merging this pull request may close these issues.

AltStyle によって変換されたページ (->オリジナル) /