Search Unity

  1. Welcome to the Unity Forums! Please take the time to read our Code of Conduct to familiarize yourself with the forum rules and how to post constructively.

When are assemblies reloaded in between state changed of PlayModeStateChange?

Discussion in 'Documentation' started by Xarbrough, Dec 1, 2020.

  1. Xarbrough

    Xarbrough

    Joined:
    Dec 11, 2014
    Posts:
    1,186
    The EditorApplication.playModeStateChanged event reports the PlayModeStateChange enum. The latter doc page also describes when these state changes happen.

    But when are assemblies reloaded in regards to the events?

    For example, if I change a static variable in ExitingEditMode, I believe it will no longer be valid in EnteredPlayMode, because the assemblies are reloaded in between (maybe even depending on the user's editor setting). However, when exiting play mode, assemblies are not reloaded at all (as far as I know). So that would be something to clearly define here in the documentation.

    Also, in what order are the events if I start the play mode in a paused state? (I can select pause before entering play mode, so the first frame is executed, but not sure).