Skip to content

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

@nadako

Description

@nadako

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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions