Skip to content

Instantly share code, notes, and snippets.

@lynxelia
Last active February 10, 2018 02:58
Show Gist options
  • Save lynxelia/635d0953c50653ceeccd98122ff82d7e to your computer and use it in GitHub Desktop.
Save lynxelia/635d0953c50653ceeccd98122ff82d7e to your computer and use it in GitHub Desktop.
Example of how to use EditorApplication.isPlayingOrWillChangePlaymode to skip time intensive code you don’t want executed when entering play mode
#if UNITY_EDITOR
if (!EditorApplication.isPlayingOrWillChangePlaymode)
{
// time intensive code you don’t want executed when entering play mode
}
#endif
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment