Deozaan

AutosaveOnRun (Unity Editor Script)

Oct 27th, 2015
220
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. using UnityEditor;
  2.  
  3. [InitializeOnLoad]
  4. public class AutosaveOnRun {
  5.     static AutosaveOnRun() {
  6.         EditorApplication.playmodeStateChanged = ()=> {
  7.             if (EditorApplication.isPlayingOrWillChangePlaymode && !EditorApplication.isPlaying) {
  8.                 EditorApplication.SaveScene();
  9.                 EditorApplication.SaveAssets();
  10.             }
  11.         };
  12.     }
  13. }
Advertisement
Add Comment
Please, Sign In to add comment