-
Notifications
You must be signed in to change notification settings - Fork 0
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
Add instance static class #41
Conversation
EcsactRunner.OnRuntimeLoad<DefaultFixedRunner>( | ||
EcsactRuntimeDefaultRegistry.RunnerType.FixedUpdate, | ||
"Default Fixed Runner" | ||
); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think instead of having OnRuntimeLoad
set the Default
we could have it return the runner in question?
Then this could look like:
EcsactRunner.OnRuntimeLoad<DefaultFixedRunner>( | |
EcsactRuntimeDefaultRegistry.RunnerType.FixedUpdate, | |
"Default Fixed Runner" | |
); | |
Ecsact.Defaults.Runner = DefaultFixedRunner.OnRuntimeLoad( | |
EcsactRuntimeDefaultRegistry.RunnerType.FixedUpdate, | |
"Default Fixed Runner" | |
); |
I'd probably rename OnRuntimeLoad
to something more appropriate, however.
@Kelwan I updated your PR to point to |
f983f50
to
9242d84
Compare
…to latest and add it all in
ea0172e
to
4bfd4bf
Compare
Runtime/EcsactDefaults.cs
Outdated
public static EcsactRuntime Runtime => _Runtime | ||
?? throw new Exception( | ||
"Runtime is null, if you want to access it as early as possible" + | ||
" use Ecsact.Defaults.WhenReady" | ||
); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
public static EcsactRuntime Runtime => _Runtime | |
?? throw new Exception( | |
"Runtime is null, if you want to access it as early as possible" + | |
" use Ecsact.Defaults.WhenReady" | |
); | |
public static EcsactRuntime Runtime => _Runtime ?? throw new Exception( | |
"Runtime is null, if you want to access it as early as possible" + | |
" use Ecsact.Defaults.WhenReady" | |
); |
Ecsact.Defaults.WhenReady(() => { | ||
Load(); | ||
}); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ecsact.Defaults.WhenReady(() => { | |
Load(); | |
}); | |
Ecsact.Defaults.WhenReady(Load); |
Closes #38