SHOW:
|
|
- or go back to the newest paste.
| 1 | using UnityEditor; | |
| 2 | ||
| 3 | [InitializeOnLoad] | |
| 4 | - | public class AutosaveOnRun |
| 4 | + | public class AutosaveOnRun {
|
| 5 | - | {
|
| 5 | + | static AutosaveOnRun() {
|
| 6 | - | static AutosaveOnRun() |
| 6 | + | EditorApplication.playmodeStateChanged = ()=> {
|
| 7 | - | {
|
| 7 | + | if (EditorApplication.isPlayingOrWillChangePlaymode && !EditorApplication.isPlaying) {
|
| 8 | - | EditorApplication.playmodeStateChanged = () => |
| 8 | + | |
| 9 | - | {
|
| 9 | + | |
| 10 | - | if (EditorApplication.isPlayingOrWillChangePlaymode && !EditorApplication.isPlaying) |
| 10 | + | |
| 11 | - | {
|
| 11 | + | |
| 12 | } | |
| 13 | } |