- Home /
How to manually reload domain?
I've disabled domain and scene reloading.
The scene can be manually reloaded like this:
[MenuItem("Tools/Reload Scene")]
public static void ReloadScene()
{
Scene activeScene = SceneManager.GetActiveScene();
EditorSceneManager.SaveScene(activeScene);
EditorSceneManager.OpenScene(activeScene.path);
}
How to manually reload domain?
I think this will work, but is there an easier way?
1) Remove EnterPlayModeOptions.DisableDomainReload flag from EditorSettings.enterPlayModeOptions
2) Save editor settings
3) Enter PlayMode
4) Exit PlayMode
5) Set EnterPlayModeOptions.DisableDomainReload flag from EditorSettings.enterPlayModeOptions
6) Save editor settings
This sounds a lot like an XY-problem. You may want to say what your goal is.
Good Point :)
static fields are not cleaned.
ScriptableObject
instances are not cleaned and Unity-events on SO not called too.
Use-cases:
I forgot to assign some inspector field and the game state is broken.
I've started the game from wrong scene.
Currently, I have to change some line in the code and wait for a full rebuild.
Your answer
Follow this Question
Related Questions
Is possible to force my game to run in a spesific OpenGL version? 0 Answers
Unity 2017.2.0p3 Editor Animation InvalidCastException Error !! 0 Answers
OnPostprocessModel and GameObject.Find() 1 Answer
Slider issue: two sliders are used, but one takes all actions for both. 0 Answers
Cogwheel icon in inspector 2 Answers