Skip to content
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

Execution order example is false in Readme #76

Open
EmirSpyke opened this issue Jan 27, 2023 · 0 comments
Open

Execution order example is false in Readme #76

EmirSpyke opened this issue Jan 27, 2023 · 0 comments

Comments

@EmirSpyke
Copy link

EmirSpyke commented Jan 27, 2023

Hello, execution order example has a false comment, it says that AstroidManager gets Initialized earlier but it not true because its execution order is bigger than GameController, also in the example project this code is almost identical, only difference is that -10 and -20 are swapped which makes the comment true in the example game1, I am posting the method in the Readme:

void InitExecutionOrder()
{
    // In many cases you don't need to worry about execution order,
    // however sometimes it can be important
    // If for example we wanted to ensure that AsteroidManager.Initialize
    // always gets called before GameController.Initialize (and similarly for Tick)
    // Then we could do the following:
    Container.BindExecutionOrder<AsteroidManager>(-10);//This should be -20
    Container.BindExecutionOrder<GameController>(-20);//This should be -10

    // Note that they will be disposed of in the reverse order given here
}
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

No branches or pull requests

1 participant