Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- using UnityEditor;
- [InitializeOnLoad]
- public class AutosaveOnRun {
- static AutosaveOnRun() {
- EditorApplication.playmodeStateChanged = ()=> {
- if (EditorApplication.isPlayingOrWillChangePlaymode && !EditorApplication.isPlaying) {
- EditorApplication.SaveScene();
- EditorApplication.SaveAssets();
- }
- };
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment