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

Provide a way to reset internal static fields (and use it in Unity) #31

Open
nadako opened this issue Jul 26, 2024 · 0 comments
Open

Provide a way to reset internal static fields (and use it in Unity) #31

nadako opened this issue Jul 26, 2024 · 0 comments

Comments

@nadako
Copy link
Owner

nadako commented Jul 26, 2024

In Unity (and maybe other environments) it is possible to restart the game in the editor without reloading .NET domain. This speeds up the iteration process by saving the time spent on reloading, but comes with the potential issues due to static fields not being reset properly.

So we should provide a method to reset our statics and use it in Unity whenever the domain is reused:

  • revision counter
  • auto-observable current
  • scheduler state

This is not the most important issue, because these static values are very short-lived, except for revision. Resetting revision, while is a logical thing to do, can cause clashes with user's own observables that persist statically through restarts without domain reloading, so this should be well-documented and maybe even toggleable through a compiler define.

@nadako nadako changed the title Provide a way to reset internal static fields and use it in Unity Provide a way to reset internal static fields (and use it in Unity) Jul 26, 2024
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